I’m currently trying to use my own camera with the Roboflow model my team have trained. I followed the tutorial from the following link:
https://blog.roboflow.com/python-webcam/
The code did work and return frames with bounded prediction boxes,
but what my team need for further work is the coordinates of the prediction boxes.
(for instance:
{‘predictions’: [{‘x’: 3586.5, ‘y’: 2875.0, ‘width’: 519, ‘height’: 250, ‘class’: ‘tomato’, ‘confidence’: 0.762, ‘image_path’: ‘/content/IMG_20220927_132641.jpg’, ‘prediction_type’: ‘ObjectDetectionModel’}, {‘x’: 3538.5, ‘y’: 1462.0, ‘width’: 711, ‘height’: 1000, ‘class’: ‘tomato’, ‘confidence’: 0.67, ‘image_path’: ‘/content/IMG_20220927_132641.jpg’, ‘prediction_type’: ‘ObjectDetectionModel’}, {‘x’: 1043.5, ‘y’: 2278.5, ‘width’: 933, ‘height’: 981, ‘class’: ‘tomato’, ‘confidence’: 0.663, ‘image_path’: ‘/content/IMG_20220927_132641.jpg’, ‘prediction_type’: ‘ObjectDetectionModel’}, {‘x’: 1793.5, ‘y’: 1168.0, ‘width’: 1337, ‘height’: 1106, ‘class’: ‘lemon’, ‘confidence’: 0.606, ‘image_path’: ‘/content/IMG_20220927_132641.jpg’, ‘prediction_type’: ‘ObjectDetectionModel’}, {‘x’: 2918.5, ‘y’: 1399.0, ‘width’: 683, ‘height’: 778, ‘class’: ‘avocado’, ‘confidence’: 0.471, ‘image_path’: ‘/content/IMG_20220927_132641.jpg’, ‘prediction_type’: ‘ObjectDetectionModel’}], ‘image’: {‘width’: 4000, ‘height’: 3000}})
However, I have difficulties finding out which part of the code can return the exact coordinates of the boxes. Is it actually possible for the API to return the exact coordinates of the boxes?