System Info
The Object detection tutorial uses the CPPE-5 dataset to finetune a DETR model. This dataset contains multiple images with wrong annotations. This is clear when inspecting the CPPE-5-v2 dataset, which removed 48 wrongly annotated images from the original CPPE-5 dataset. One obvious example is image_id 762, which is declared as 1200 × 1200 pixels while being obviously rectangular (the image is in fact 2246 × 1498 pixels). As you can see, displaying the bounding boxes on this image using the code from the tutorial gives nonsensical results:

Even more problematic, when preprocessing some images in this dataset with Albumentations, this can trigger exceptions that are uncaught by the current code. For example, consider image_id 83. It is annotated as a
2481 × 1478, despite being in fact 1000 × 600 pixels, and its objects are as follow.
{
"id": [ 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673 ],
"area": [ 24705, 14155, 21672, 13065, 20150, 15990, 18260, 12348, 17554, 16092, 14740, 19890, 67554, 53118, 46125, 56376, 839188, 624780, 658000, 679782 ],
"bbox": [ [ 212, 392, 135, 183 ], [ 564, 866, 95, 149 ], [ 703, 421, 126, 172 ], [ 1019, 840, 65, 201 ], [ 1187, 458, 130, 155 ], [ 1505, 880, 78, 205 ], [ 1568, 542, 110, 166 ], [ 1915, 1016, 98, 126 ], [ 305, 229, 134, 131 ], [ 805, 320, 149, 108 ], [ 1302, 324, 134, 110 ], [ 1744, 360, 170, 117 ], [ 248, 122, 243, 278 ], [ 761, 217, 227, 234 ], [ 1255, 266, 225, 205 ], [ 1714, 277, 232, 243 ], [ 71, 84, 602, 1394 ], [ 624, 143, 468, 1335 ], [ 1095, 162, 500, 1316 ], [ 1516, 205, 534, 1273 ] ],
"category": [ 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 1, 1, 1, 1, 0, 0, 0, 0 ]
}
The bounding box [1505, 880, 78, 205] is entirely outside the image. The way the code runs on the two machines I've tested, this is normalized by albumentations (which apparently uses the actual dimensions of the image rather than the dataset annotations) into a bounding box of [1., 1., 1., 1.], which then triggers an Error: x_max is less than or equal to x_min for bbox [1. 1. 1. 1. 2.]. I'm not sure why this happens despite passing clip=True, min_area=25 as arguments to albumentations.Compose(), but given that the error clearly comes from an erroneous dataset, I don't care too much. In total, there are 12 bounding boxes that trigger similar errors for image_id 83 alone, and image_ids 97 and 702 also trigger similar errors.
I'm not sure why this breaks down now and hasn't been caught before. It might be something of the particular combo of OS and library versions I'm using. I'm happy to provide more details into those if needed, but the issue fundamentally comes from the dataset itself, and it seems unwise to have the tutorial silently rely on ignoring erroneous data. Similarly, I didn't include code snippets that will demonstrate this behavior, but I'm happy to do so on request.
Who can help?
No response
Information
Tasks
Reproduction
Run the code as given on [[https://huggingface.co/docs/transformers/tasks/object_detection]] up to model training.
Alternatively, after the line cppe5["train"] = cppe5["train"].with_transform(train_transform_batch), trying to access cppe5["train"][XXX] such that we access image_id 83, 97, or 702 will trigger similar errors.
Expected behavior
Training completes without errors.
System Info
The Object detection tutorial uses the CPPE-5 dataset to finetune a DETR model. This dataset contains multiple images with wrong annotations. This is clear when inspecting the CPPE-5-v2 dataset, which removed 48 wrongly annotated images from the original CPPE-5 dataset. One obvious example is
image_id762, which is declared as 1200 × 1200 pixels while being obviously rectangular (the image is in fact 2246 × 1498 pixels). As you can see, displaying the bounding boxes on this image using the code from the tutorial gives nonsensical results:Even more problematic, when preprocessing some images in this dataset with Albumentations, this can trigger exceptions that are uncaught by the current code. For example, consider
image_id83. It is annotated as a2481 × 1478, despite being in fact 1000 × 600 pixels, and its objects are as follow.
{ "id": [ 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673 ], "area": [ 24705, 14155, 21672, 13065, 20150, 15990, 18260, 12348, 17554, 16092, 14740, 19890, 67554, 53118, 46125, 56376, 839188, 624780, 658000, 679782 ], "bbox": [ [ 212, 392, 135, 183 ], [ 564, 866, 95, 149 ], [ 703, 421, 126, 172 ], [ 1019, 840, 65, 201 ], [ 1187, 458, 130, 155 ], [ 1505, 880, 78, 205 ], [ 1568, 542, 110, 166 ], [ 1915, 1016, 98, 126 ], [ 305, 229, 134, 131 ], [ 805, 320, 149, 108 ], [ 1302, 324, 134, 110 ], [ 1744, 360, 170, 117 ], [ 248, 122, 243, 278 ], [ 761, 217, 227, 234 ], [ 1255, 266, 225, 205 ], [ 1714, 277, 232, 243 ], [ 71, 84, 602, 1394 ], [ 624, 143, 468, 1335 ], [ 1095, 162, 500, 1316 ], [ 1516, 205, 534, 1273 ] ], "category": [ 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 1, 1, 1, 1, 0, 0, 0, 0 ] }The bounding box
[1505, 880, 78, 205]is entirely outside the image. The way the code runs on the two machines I've tested, this is normalized by albumentations (which apparently uses the actual dimensions of the image rather than the dataset annotations) into a bounding box of [1., 1., 1., 1.], which then triggers anError: x_max is less than or equal to x_min for bbox [1. 1. 1. 1. 2.]. I'm not sure why this happens despite passingclip=True, min_area=25as arguments toalbumentations.Compose(), but given that the error clearly comes from an erroneous dataset, I don't care too much. In total, there are 12 bounding boxes that trigger similar errors forimage_id83 alone, andimage_ids 97 and 702 also trigger similar errors.I'm not sure why this breaks down now and hasn't been caught before. It might be something of the particular combo of OS and library versions I'm using. I'm happy to provide more details into those if needed, but the issue fundamentally comes from the dataset itself, and it seems unwise to have the tutorial silently rely on ignoring erroneous data. Similarly, I didn't include code snippets that will demonstrate this behavior, but I'm happy to do so on request.
Who can help?
No response
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
Run the code as given on [[https://huggingface.co/docs/transformers/tasks/object_detection]] up to model training.
Alternatively, after the line
cppe5["train"] = cppe5["train"].with_transform(train_transform_batch), trying to accesscppe5["train"][XXX]such that we accessimage_id83, 97, or 702 will trigger similar errors.Expected behavior
Training completes without errors.