I have build an Object Detection Model. I am trying to test model and JSON values it returns using following ways.
- Try This model option on Dataset Version tab
- Try This Model Option from Deploy Tab
- Python Code
- when I use Try This model from Dataset Version Tab as in image 1 below
Image 1
I get JSON values as following (image 2)
Image 2
- But when I use Try This Model Option from Deploy tab there are different JSON values for the same image (in following image)
Image 3
- And the python code
print(model.predict("/content/50.jpg", confidence=80, overlap=50).json())
also prints these same values (as in image 3)
{
"predictions": [
{
"x": 428.0,
"y": 294.5,
"width": 280.0,
"height": 395.0,
"confidence": 0.9443135261535645,
"class": "plant",
"class_id": 0,
"image_path": "50.jpg",
"prediction_type": "ObjectDetectionModel"
},
{
"x": 86.0,
"y": 450.5,
"width": 26.0,
"height": 137.0,
"confidence": 0.8782252073287964,
"class": "ref_obj",
"class_id": 1,
"image_path": "50.jpg",
"prediction_type": "ObjectDetectionModel"
}
],
"image": {
"width": "800",
"height": "800"
}
}
Why there are different values? When I use any of these JSON values in my own python code to create bounding boxes, I always get wrong orientation. It means there is a bug in returning these JSON values.
see the following output from my code for creating bounding boxes using above JSON values.
Image 4
According to my calculation the roboflow python code and interface should return following JSON values for my image
{
"predictions": [
{
"x": 288.0,
"y": 97.5,
"width": 280.0,
"height": 395.0,
"confidence": 0.9443135261535645,
"class": "plant",
"class_id": 0,
"image_path": "50.jpg",
"prediction_type": "ObjectDetectionModel"
},
{
"x": 72.0,
"y": 382.0,
"width": 26.0,
"height": 137.0,
"confidence": 0.8782252073287964,
"class": "ref_obj",
"class_id": 1,
"image_path": "50.jpg",
"prediction_type": "ObjectDetectionModel"
}
],
"image": {
"width": "800",
"height": "800"
}
}
then I’ll get correct bounding box by using these JSON values as following
Image 5
All the three JSON values that Roboflow interface gives is incorrect. Request you to please resolve this issue ASAP.