-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-ts.sh
executable file
·52 lines (46 loc) · 1.12 KB
/
test-ts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# check if works for image files
curl -s -X POST http://localhost:8080/predictions/retail-yolo -T ./sample_image.jpg
# check if works for JSON with base64 encoded images
cat > ./sample_request.json <<END
{
"instances": [
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
}
]
}
END
curl -s -X POST \
-H "Content-Type: application/json; charset=utf-8" \
-d @sample_request.json \
http://localhost:8080/predictions/retail-yolo/
# check if works for JSON with base64 encoded images batches
cat > ./sample_request_batch.json <<END
{
"instances": [
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
},
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
},
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
},
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
},
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
},
{
"data": "$(base64 -w 0 -i ./sample_image.jpg)"
}
]
}
END
curl -s -X POST \
-H "Content-Type: application/json; charset=utf-8" \
-d @sample_request_batch.json \
http://localhost:8080/predictions/retail-yolo/