Spaces:
Sleeping
Sleeping
kadabengaran
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -100,35 +100,7 @@ with gr.Blocks() as demo:
|
|
100 |
|
101 |
btn.click(face_verification_uii, inputs=[img1, img2, dist, model, detector], outputs=output)
|
102 |
|
103 |
-
|
104 |
-
app.mount("/gradio", gradio_app)
|
105 |
-
|
106 |
-
@app.get("/", response_class=HTMLResponse)
|
107 |
-
async def root():
|
108 |
-
"""
|
109 |
-
Redirect root to the Gradio app
|
110 |
-
"""
|
111 |
-
# Check if running on Hugging Face Spaces
|
112 |
-
if os.getenv("SPACE_ID"):
|
113 |
-
# Running on Hugging Face Spaces
|
114 |
-
gradio_url = "https://kadabengaran-face-verify.hf.space/gradio/"
|
115 |
-
else:
|
116 |
-
# Running locally
|
117 |
-
gradio_url = "/gradio"
|
118 |
-
|
119 |
-
return HTMLResponse(f"""
|
120 |
-
<!DOCTYPE html>
|
121 |
-
<html>
|
122 |
-
<head>
|
123 |
-
<title>Gradio App</title>
|
124 |
-
</head>
|
125 |
-
<body style="margin: 0; padding: 0; overflow: hidden;">
|
126 |
-
<iframe src="{gradio_url}" style="width: 100%; height: 100vh; border: none;"></iframe>
|
127 |
-
</body>
|
128 |
-
</html>
|
129 |
-
""")
|
130 |
-
|
131 |
-
# Running Both Servers
|
132 |
if __name__ == "__main__":
|
133 |
import uvicorn
|
134 |
|
|
|
100 |
|
101 |
btn.click(face_verification_uii, inputs=[img1, img2, dist, model, detector], outputs=output)
|
102 |
|
103 |
+
# Running Servers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
if __name__ == "__main__":
|
105 |
import uvicorn
|
106 |
|