Closed stellasphere closed 1 month ago
I think the issue is with invalid images, I see a lot of it in other projects.
We need a verbose mode explaining why it failed.
I tested here:
>>> from PIL import Image
>>> image = Image.open("image.jpg")
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=4080x3072>
>>> image.format
"JPEG"
The issue is probably with invalid images. We can use filetype
lib to get the real type and give a good warning when file extension doesn't match expected mime extension:
>>> import filetype
>>> kind = filetype.guess("original.jpg")
>>> kind.extension
'avif'
>>> kind.mime
'image/avif'
Closing this one because I merged #284 with a more complete solution.
Description
We support many other formats other than the ones we currently allow. We also lost
jpg
(notjpeg
) support in PR #51 (https://github.com/roboflow/roboflow-python/pull/51/files#diff-05ecffcd056f67631588da1975ca43403a88910478c8435876abcdd85b7a8025)Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Tested locally and in this colab: https://colab.research.google.com/drive/1oRqgsKEiihpVpxz5sAWXfTq5L4Eq_zdY?usp=sharing