Silly question? Width and Height don't match Image size, Bounding boxes are off

#6
by NotSarahConnor1984 - opened

Example with image_id=762. In the image tag, size=2246x1498. But the width tag is 1200 and the height tag is 1200. Also, the bouding boxes are off when displayed on the image. If that is expected, can someone briefly explain what I am missing or misunderstanding here?

Here's the full dataset row for that specific image in the training dataset.

{'image_id': 762,
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=2246x1498>,
'width': 1200,
'height': 1200,
'objects': {'id': [3403,
3404,
3405,
3406,
3407,
3408,
3409,
3410,
3411,
3412,
3413],
'area': [17780,
17500,
11656,
13320,
1750,
11136,
10283,
18300,
267526,
72165,
14760],
'bbox': [[182.0, 492.0, 140.0, 127.0],
[514.0, 483.0, 175.0, 100.0],
[1042.0, 483.0, 124.0, 94.0],
[463.0, 811.0, 148.0, 90.0],
[287.0, 905.0, 70.0, 25.0],
[344.0, 908.0, 116.0, 96.0],
[702.0, 742.0, 113.0, 91.0],
[798.0, 761.0, 150.0, 122.0],
[1.0, 512.0, 394.0, 679.0],
[907.0, 515.0, 283.0, 255.0],
[955.0, 424.0, 180.0, 82.0]],
'category': [4, 4, 4, 2, 2, 2, 2, 2, 0, 0, 3]}}

Another thing: I followed this excellent page: https://huggingface.co/docs/transformers/en/tasks/object_detection#load-the-cppe-5-dataset

You can see the issue when visualising the image_id 762. The bounding boxes don't match anything (the image seems too large for them). Not sure why this is happening, but clearly that's no good as a training example.

Sign up or log in to comment