tensorflow / tensorflow/models
Image FORMAT check in create_pascal_tf_record.py raises a Value Error if images are stored with .jpg extention.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
1. The entire URL of the file you are using(https://github.com/tensorflow/models/tree/master/research/object_detection/dataset_tools/create_pascal_tf_record.py
2. Describe the bug
The image format check for jpeg images (@ line number 90 using PIL package) only works if the images are having .jpeg extention and fails if the images have .jpg extention. It would have been great if the code could work for .jpg extention as well since it is also a valid jpeg format. Changing extention of thousands of images from .jpg to .jpeg and then syncing the file names with the corresponding annotation files in .xml is a cubersome process!!!!.
3. Steps to reproduce
A ' value error: Image not in JPEG format ' is raised while creating tfrecord file by using PascalVoc format. However the issue resolves if all images are changed to .jpeg instead of .jpg ( Which is not an easy resolve! ) . The same issue is raised while using model maker library as well. The PIL.Image.Open might be the possible source of this error.
4. Expected behavior
The image format check must work even for images with .jpg extention.
5. Additional context
..
6. System information
Using Google Colab GPU/TPU
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in research/object_detection/dataset_tools/create_pascal_tf_record.py around line 90 and reproduce the Pascal VOC conversion with images using the .jpg extension. Inspect the PIL-based format check and any related tests; done means valid JPEG images with either .jpg or .jpeg extensions are accepted without changing annotation filenames.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100