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

Fix after suggestion #206

Merged
merged 3 commits into from
Jun 26, 2020
Merged

Fix after suggestion #206

merged 3 commits into from
Jun 26, 2020

Conversation

ml5ah
Copy link
Contributor

@ml5ah ml5ah commented Jun 26, 2020

Hi @glenn-jocher
Thanks for your input yesterday.

I have modified the PR as per your suggestion.

detect.py now creates separate txt files for each frame for videos, keeping image txt files the same.

For example:
video.mp4 containing 100 frames would now result in video_1.txt, video_2.txt, ..., video_100.txt

Also, I hope you don't mind, I changed the variable name from 'file' to 'f'. Using file as a variable name is not prohibited but since it is a builtin, it might cause issues later on.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved model attribute access and output file handling in YOLOv5 detection script.

📊 Key Changes

  • Altered model name retrieval to support wrapped models in Distributed Data Parallel (DDP) training.
  • Streamlined the output text file path generation, particularly for video frame results.
  • Commented out block that showed an example of updating all model variants (not an active code change, but indicative of potential usage).

🎯 Purpose & Impact

  • Ensures compatibility with DDP, which wraps the model in an additional module, thereby preventing errors when trying to access model attributes. 🤹
  • Simplifies and corrects the generation and saving of result text files for better organization and to align with video frame indexing. This makes it easier for users to associate results with the correct frames or images. 📝
  • The commented-out section serves as an example for users who might want to apply the detection script across multiple model weights, although this is not a functional change in the codebase. This can help guide users on how to adapt the script for bulk processing. 🔄

ml5ah and others added 3 commits June 25, 2020 18:23
Added some recent updates that were missing, and updated the filename with an if else.
@glenn-jocher
Copy link
Member

Looks all good now. Thanks for the PR!

@glenn-jocher glenn-jocher merged commit 97b5186 into ultralytics:master Jun 26, 2020
@ml5ah
Copy link
Contributor Author

ml5ah commented Jun 26, 2020

Thanks @glenn-jocher!

@ml5ah ml5ah deleted the utils-fix branch June 26, 2020 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants