Accessing Bounding Box Coordinates From a Model

Preliminary Information

I am new to TensorFlow and have created a basic model using an online tutorial. My aim is to deploy the model within a python script, access the real-time bounding box coordinates of the detected object (in TF Lite), and then process those coordinates in the python script.

This is a basic operation but feels very daunting for me. All I know is that I can launch the model using the command python my_model.py --modeldir-custom_model_lite, and that the python command visualize_boxes_and_labels_on_image_array has something to do with determining bounding box coordinates. While my long-term aim is to learn the foundations of TF, for expediency’s sake I’d just like to fill in the gap in my knowledge between deploying the model and accessing the model’s bounding box coordinates in a python script.

My Question

How do I access the bounding box coordinates from this model? Do I need to deploy it first, and then when it is running I then run the above python command in a python interpreter? What commands do I use? What else should I know?

I appreciate any help, even if its just a high level overview of what I should know and do to implement this within python. Thanks.

Hi @Bradley_Bravender,

Generally when you train object detection model tries to predict the bounding box location and the class probablity, you don’t need to run any extra function to get the bounding boxes. To plot those bounding boxes on a Image you can use visualize_boxes_and_labels_on_image_array which will help to normalize the bounding box coordinates to the original image size.

Please check this tutorial which has end to end training of object detection using latest tensorflow model garden. At the end of this tutorial you can see how the model is used for predicting on new images. Please let me know if you want further clarification on this.

Thanks.