objectdetectionapi / curl_request.sh
qmaruf's picture
curl request added
4d95312
raw
history blame contribute delete
593 Bytes
#!/bin/bash
# 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