File size: 593 Bytes
4d95312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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