lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
1.64k stars 178 forks source link

PIL.Image.DecompressionBombError #337

Open WaderLaken opened 1 week ago

WaderLaken commented 1 week ago

当训练图片过大可能会报如下错:

PIL.Image.DecompressionBombError: Image size (388778250 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

解决:自行修改图像最大限制,rtdetr_pytorch/src/data/transforms.py 文件添加如下代码:

from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
Image.MAX_IMAGE_PIXELS = None