Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility with GIF images #6403

Closed
wants to merge 2 commits into from
Closed

Add compatibility with GIF images #6403

wants to merge 2 commits into from

Conversation

FTD-YI
Copy link

@FTD-YI FTD-YI commented Jan 24, 2022

Some images have the extension PNG but are actually GIF, the dataset file needs to handle this case.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced image loading to support GIFs in YOLOv5.

📊 Key Changes

  • Modified image loading logic to handle GIF files using OpenCV.
  • Incorporated a conditional check to read a frame from GIF if standard image loading fails.
  • Ensured proper release of GIF resources after reading.

🎯 Purpose & Impact

  • Purpose: Allows YOLOv5 to process GIF images directly, expanding the range of compatible image formats.
  • Impact: Users can now use GIFs in their datasets without pre-converting them to static image formats, simplifying workflows and enabling new use cases. 🔄🖼️

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @FTD-YI, thank you for submitting a 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with upstream/master. If your PR is behind upstream/master an automatic GitHub actions rebase may be attempted by including the /rebase command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature  # <----- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • ✅ Verify all Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@glenn-jocher
Copy link
Member

glenn-jocher commented Jan 24, 2022

@FTD-YI it's not clear that GIFs should be included in training data, as there is ambiguity as to which frame of the GIF the labels.txt file would apply.

After investigating a bit I've added gif to the included suffix list for videos in #6410, allowing detect.py full gif inference capability (handling gifs as videos, running inference on every frame).

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions YOLOv5 🚀 and Vision AI ⭐.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Feb 26, 2022
@github-actions github-actions bot closed this Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Stale and schedule for closing soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants