Spaces:
Runtime error
Runtime error
Update gradio/app.py
Browse files- gradio/app.py +13 -5
gradio/app.py
CHANGED
|
@@ -274,13 +274,21 @@ app = FastAPI()
|
|
| 274 |
|
| 275 |
@app.post("/api/compare_face")
|
| 276 |
async def compare_face(image1: UploadFile = File(...), image2: UploadFile = File(...)) -> Dict:
|
| 277 |
-
#
|
| 278 |
-
return
|
|
|
|
|
|
|
| 279 |
|
| 280 |
if __name__ == '__main__':
|
| 281 |
g_activation_result = activate_sdk()
|
| 282 |
# launch_demo(g_activation_result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
-
gr_app = gr.mount_gradio_app(app,
|
| 285 |
-
|
| 286 |
-
|
|
|
|
|
|
| 274 |
|
| 275 |
@app.post("/api/compare_face")
|
| 276 |
async def compare_face(image1: UploadFile = File(...), image2: UploadFile = File(...)) -> Dict:
|
| 277 |
+
# Load image bytes, run comparison...
|
| 278 |
+
# For now, return a dummy result
|
| 279 |
+
return {"match": True, "confidence": 0.94}
|
| 280 |
+
|
| 281 |
|
| 282 |
if __name__ == '__main__':
|
| 283 |
g_activation_result = activate_sdk()
|
| 284 |
# launch_demo(g_activation_result)
|
| 285 |
+
dummy_interface = gr.Interface(
|
| 286 |
+
fn=lambda x: "API ready.",
|
| 287 |
+
inputs=gr.Textbox(label="Info"),
|
| 288 |
+
outputs=gr.Textbox(label="Response")
|
| 289 |
+
)
|
| 290 |
|
| 291 |
+
gr_app = gr.mount_gradio_app(app, dummy_interface)
|
| 292 |
+
|
| 293 |
+
import uvicorn
|
| 294 |
+
uvicorn.run(gr_app, host="0.0.0.0", port=7860)
|