Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在参加OCR十讲课程中,有使用到官方指定的数据集det_data_lesson_demo。在使用过程中发现,其中有很多是gif格式的图片(但后缀是
.jpg
),通过PaddleOCR官方的代码读取这些数据后全部为None(例如:mtwi/train/TB1Zj7Un4rI8KJjy0FpXXb5hVXa_!!1-item_pic.gif.jpg
),还有些数据opencv会报Corrupt JPEG data
看着很难受(例如:xfun/train/zh_train_43.jpg
)。详情可以查看 #5092。PaddleOCR官方读取图片方式精简如下:
我将图片读取的方式修改成:
通过我提供的方式读取gif图片时能够正常读取不会为None,并且也解决了opencv报
Corrupt JPEG data
警告的问题。