qmaruf commited on
Commit
4d95312
·
1 Parent(s): 2e6f8b0

curl request added

Browse files
Files changed (1) hide show
  1. curl_request.sh +17 -0
curl_request.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Step 1: Send the image and get the event ID
4
+ EVENT_ID=$(curl -s -X POST "https://qmaruf-objectdetectionapi.hf.space/gradio_api/call/predict" \
5
+ -H "Content-Type: application/json" \
6
+ -d '{
7
+ "data": [
8
+ {
9
+ "path": "https://media.designcafe.com/wp-content/uploads/2021/12/27144355/design-cafe-modular-furniture-benefits.jpg",
10
+ "meta": {"_type":"gradio.FileData"}
11
+ }
12
+ ]
13
+ }' | awk -F'"' '{print $4}')
14
+
15
+ # Step 2: Fetch the prediction result using the event ID
16
+ curl -N "https://qmaruf-objectdetectionapi.hf.space/gradio_api/call/predict/$EVENT_ID"
17
+ echo