I wonder if orientation exif data was accidentally stripped from these images. There are plenty for which the height and width in annotations.json are flipped from the actual images height and width. For example 056091.jpg
The annotation json says:
{'id': 56091, 'file_name': '056091.jpg', 'width': 3456, 'height': 4608}
However the unrotated image has a width of 4608 and height of 3456.
The exif data doesn’t include any orientation details
identify -format '%[orientation]' detectron_datasets/food/train/056091.jpg
Undefined
This is easy to correct for images which have differing width and height, however I cannot correct square images, as their dimensions don’t clue me in to whether they’re rotated. Additionally it’s unclear whether the rotation for rectangles is 90 degrees or 270 degrees.
@shivam do you know if a mistake was made resulting in the exif data being stripped in the dataset?
Further details
Other images which have opposite (height, width)
of annotations.json
:
{'id': 8617, 'file_name': '008617.jpg', 'width': 3024, 'height': 4032}
{'id': 8619, 'file_name': '008619.jpg', 'width': 3024, 'height': 4032}
{'id': 8626, 'file_name': '008626.jpg', 'width': 3024, 'height': 4032}
{'id': 8620, 'file_name': '008620.jpg', 'width': 3024, 'height': 4032}
{'id': 8817, 'file_name': '008817.jpg', 'width': 3024, 'height': 4032}
{'id': 8869, 'file_name': '008869.jpg', 'width': 3024, 'height': 4032}
{'id': 8919, 'file_name': '008919.jpg', 'width': 3024, 'height': 4032}
{'id': 8934, 'file_name': '008934.jpg', 'width': 3024, 'height': 4032}
{'id': 11967, 'file_name': '011967.jpg', 'width': 3024, 'height': 4032}
{'id': 12045, 'file_name': '012045.jpg', 'width': 3024, 'height': 4032}
{'id': 13989, 'file_name': '013989.jpg', 'width': 3024, 'height': 4032}
{'id': 17312, 'file_name': '017312.jpg', 'width': 2448, 'height': 3264}
{'id': 21923, 'file_name': '021923.jpg', 'width': 2322, 'height': 4128}
{'id': 23295, 'file_name': '023295.jpg', 'width': 2322, 'height': 4128}
{'id': 23296, 'file_name': '023296.jpg', 'width': 2322, 'height': 4128}
{'id': 23975, 'file_name': '023975.jpg', 'width': 2322, 'height': 4128}
{'id': 23976, 'file_name': '023976.jpg', 'width': 2322, 'height': 4128}
{'id': 8618, 'file_name': '008618.jpg', 'width': 3024, 'height': 4032}
{'id': 8621, 'file_name': '008621.jpg', 'width': 3024, 'height': 4032}
{'id': 8627, 'file_name': '008627.jpg', 'width': 3024, 'height': 4032}
{'id': 8628, 'file_name': '008628.jpg', 'width': 3024, 'height': 4032}
{'id': 8864, 'file_name': '008864.jpg', 'width': 3024, 'height': 4032}
{'id': 49396, 'file_name': '049396.jpg', 'width': 3456, 'height': 4608}
{'id': 50167, 'file_name': '050167.jpg', 'width': 1960, 'height': 4032}
{'id': 53873, 'file_name': '053873.jpg', 'width': 3456, 'height': 4608}
{'id': 53875, 'file_name': '053875.jpg', 'width': 3456, 'height': 4608}
{'id': 53879, 'file_name': '053879.jpg', 'width': 3456, 'height': 4608}
{'id': 56091, 'file_name': '056091.jpg', 'width': 3456, 'height': 4608}
(again note: this isn’t a comprehensive list of rotated images, as some rectangular images may be rotated 180 degrees, and square images aren’t detected)
- Number of incorrect flipped width/height rectangular images: 28
- Estimated number of rotated rectangular images considering that some may be 180 degrees and unaccounted for: 42
- Total rectangular images in training set: 22903
- Estimated % with unaccounted for rotations: 0.183%
- Total images including squares: 54392
- Estimated unaccounted for rotated images: 99.7