Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,7 +93,15 @@ def process_and_describe(payload: dict):
|
|
| 93 |
# Added better error handling as suggested previously
|
| 94 |
return {"error": str(e)}
|
| 95 |
|
| 96 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
|
|
|
|
|
|
| 99 |
demo.launch(mcp_server=True)
|
|
|
|
| 93 |
# Added better error handling as suggested previously
|
| 94 |
return {"error": str(e)}
|
| 95 |
|
| 96 |
+
# --- Gradio MCP Interface ---
|
| 97 |
+
demo = gr.Interface(
|
| 98 |
+
fn=process_and_describe,
|
| 99 |
+
inputs=gr.JSON(label="Input Payload (Dict format with 'image_b64')"),
|
| 100 |
+
outputs=gr.JSON(label="Reply to Jetson"),
|
| 101 |
+
api_name="predict"
|
| 102 |
+
)
|
| 103 |
|
| 104 |
if __name__ == "__main__":
|
| 105 |
+
# You will need to install the required libraries:
|
| 106 |
+
# pip install gradio huggingface_hub Pillow requests
|
| 107 |
demo.launch(mcp_server=True)
|