Spaces:
Sleeping
Sleeping
Download curl_request.sh from qmaruf/objectdetectionapi: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/spaces/qmaruf/objectdetectionapi/resolve/main/curl_request.sh
- Command line
-
hf download hf://spaces/qmaruf/objectdetectionapi/curl_request.sh
-
curl -L -o curl_request.sh https://huggingface.co/spaces/qmaruf/objectdetectionapi/resolve/main/curl_request.sh
593 Bytes
| # Step 1: Send the image and get the event ID | |
| EVENT_ID=$(curl -s -X POST "https://qmaruf-objectdetectionapi.hf.space/gradio_api/call/predict" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "data": [ | |
| { | |
| "path": "https://media.designcafe.com/wp-content/uploads/2021/12/27144355/design-cafe-modular-furniture-benefits.jpg", | |
| "meta": {"_type":"gradio.FileData"} | |
| } | |
| ] | |
| }' | awk -F'"' '{print $4}') | |
| # Step 2: Fetch the prediction result using the event ID | |
| curl -N "https://qmaruf-objectdetectionapi.hf.space/gradio_api/call/predict/$EVENT_ID" | |
| echo | |