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

Update detect.py (Fix save-csv: Ensure header is written to CSV) #13472

Merged
merged 2 commits into from
Jan 1, 2025

Conversation

aligh993
Copy link
Contributor

@aligh993 aligh993 commented Dec 26, 2024

This commit resolves an issue where the save-csv command did not write the CSV header. The code now correctly saves the header in the CSV file.

I have read the CLA Document and I sign the CLA

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced CSV logging functionality in YOLOv5 for improved usability and bug prevention. 🛠️📊

📊 Key Changes

  • Fixed a bug in detect.py where CSV headers were inconsistently written.
  • Replaced the incorrect csv_path.is_file() check with os.path.isfile(csv_path) for proper file validation before appending data.

🎯 Purpose & Impact

  • 🐛 Bug Fix: Ensures headers in the CSV file are only written once, preventing duplicates or formatting issues.
  • 📂 Improved Usability: Guarantees smooth operation of prediction logging, especially during repeated runs.
  • 📈 User Benefit: Users analyzing predictions through CSV logs now experience more reliable and clean data formatting.

This commit resolves an issue where the save-csv command did not write the CSV header. The code now correctly saves the header in the CSV file.

Signed-off-by: Ali Ghanbari <[email protected]>
Copy link
Contributor

github-actions bot commented Dec 26, 2024

All Contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@aligh993 aligh993 mentioned this pull request Dec 31, 2024
2 tasks
@glenn-jocher glenn-jocher merged commit f003c3d into ultralytics:master Jan 1, 2025
8 checks passed
@UltralyticsAssistant
Copy link
Member

🚀 Big news! The PR by @aligh993 with contributions from @glenn-jocher has officially been merged. 🎉 Your dedication and attention to detail have elevated YOLOv5’s CSV logging to new heights—helping ensure clean, reliable, and user-friendly data handling for all. 📊✨

As Marcus Aurelius once said, "What we do now echoes in eternity." Your fixes might feel like small steps, but they create ripples of impact for researchers, developers, and innovators worldwide. 🌍 Thank you both for making a difference—one line of code at a time! ❤️🙏

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.

3 participants