This is a flask application with tensorflow 2 object detection API deployed. The user hits the endpoint with image data and gets a response which consists of detections with scores, image data with overlay, image size (can be customized).
- You need to setup the tensorflow object detection API. Here are some of the great articles that will help you in the process, tutorial1, tutorial2.
- You can the download the required model from tensorflow model zooand specify the saved_model, labelmap path in the
main.py
file client.py
is used hit the endpoint. You have to specify the url with endpoint, image_path, output_dir(the dir where you want your image with overlay to be saved. It's optional), in theclient.py
file.
- first run
python main.py
to get the app running and then to hit the endpoint with required arguments, runpython client.py
The response consists of
- detections with scores
- image data with overlay. This can be decoded back to a numpy array and can be written to disk to visualize the result (provided in
client.py
) - image size