yunjey / pytorch-tutorial

PyTorch Tutorial for Deep Learning Researchers
MIT License
29.79k stars 8.03k forks source link

Update resize.py #183

Open Anirudh257 opened 5 years ago

Anirudh257 commented 5 years ago

Added the lines "ImageFile.LOAD_TRUNCATED_IMAGES = True" to ensure that even truncated images can be downloaded and " if imghdr.what(os.path.join(image_dir, image)) != None:" to load only correct images and ignore corrupted images.