I am trying to write a bash script to take an image in the current directory "index.jpg" and pass the base64 value of that file to the DOODS2 server via POST.
The response i am getting is:
{"detail":[{"loc":["body"],"msg":"instance of DetectRequest, tuple or dict expected","type":"type_error.dataclass","ctx":{"class_name":"DetectRequest"}}]}%
I am trying to write a bash script to take an image in the current directory "index.jpg" and pass the base64 value of that file to the DOODS2 server via POST.
The response i am getting is:
{"detail":[{"loc":["body"],"msg":"instance of DetectRequest, tuple or dict expected","type":"type_error.dataclass","ctx":{"class_name":"DetectRequest"}}]}%
Here is my current script:
!/bin/bash
image=./index.jpg content=$(base64 $image) body='{ "id": "test", "detector_name": "mobiledet_320x320_edgetpu", "data": "$content", "image": "jpeg", "throttle": 5, "preprocess": [ "grayscale" ], "detect": { "person": 50 }, "regions": [ {"id": "someregion", "top": 0.1, "left": 0.1, "bottom": 0.9, "right": 0.9, "detect": {"*":50}, "covers": false} ], "separate_detections" : false, "crop": false, "binary_images" : false, }'
url="http://192.168.7.26:8081/detect"
curl -X POST -d "$body" "$url"
(Not sure why wrapping that in code tags did not work like it did on the response.)