-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
Fix LoadImages()
with dataset YAML lists
#8517
Conversation
LoadImages()
with dataset YAML lists
@democat3457 PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
@democat3457 BTW I think this expanded capability might be used in detect.py to add for example a list of inference objects (images, videos, directories, etc.) Maybe a new Usage method could be a text file or CSV file with inference targets. Right now we reserve sources.txt for streaming sources, but we could restructure so if a file is passed streams would require a *.streams extension and *.txt and *.csv files would be parsed inside or before LoadImages, i.e.: python detect.py --source files.txt
python detect.py --source files.csv
python detect.py --source rtsp.streams # old usage --source streams.txt |
👀 interesting idea one potential thing that would have to be reworked though, is that if the source argument gets a list of files as you suggest, if there are multiple videos in that file, they would (currently) all get written to the same annotated video rather than in all separate videos |
@democat3457 oh no don't worry, multiple videos, and even multiple files + multiple videos are already handled automatically when pointing to a directory, i.e. this works perfectly well today:
|
ah I see, I missed the part where the it feels like switching the extension from we could also support |
@democat3457 yes, we try to avoid breaking changes when possible, though sometimes it's unavoidable and then we post a warning message on the PR to let users know. |
* Fix LoadImages with dataset yaml lists * Update dataloaders.py * Update dataloaders.py * Simplify/refactor PR * Update dataloaders.py Co-authored-by: Colin Wong <[email protected]> Co-authored-by: Glenn Jocher <[email protected]>
When using the tflite export with a yolov5 dataset.yaml that contains a list of train/val paths rather than a single path, the tflite exporter fails with the message,
Expected str, bytes or os.PathLike object, not list
- this is because the return object fromcheck_dataset(data)['train']
is a list of strings if thetrain
entry in the dataset.yaml is a list as well.This PR aims to correct this by allowing the input parameter
path
to be a list as well and simply extending thefiles
list for subsequent paths.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhanced flexibility in specifying input sources for image and video processing in YOLOv5.
📊 Key Changes
FileNotFoundError
instead of genericException
.🎯 Purpose & Impact
FileNotFoundError
to better guide users when input paths are incorrect.