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 non-fixed path option to coco's instances_val2017.json #11860

Merged
merged 1 commit into from
Jul 23, 2023

Conversation

malashinroman
Copy link
Contributor

@malashinroman malashinroman commented Jul 14, 2023

Very small fix without which I have an error at the end of each training session
[Errno 2] No such file or directory: '../datasets/coco/annotations/instances_val2017.json

πŸ€– Generated by Copilot at 123b23d

Summary

πŸ› οΈπŸ—‚οΈπŸ›

The pull request improves the annotation file handling for the COCO validation dataset in val.py. It adds a fallback option to look for the file in the annotations subfolder if it is not found in the image folder.

annotation path
not always where expected
try annotations

Walkthrough

  • Add a fallback option for the COCO annotation file path (link in val.py)

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced flexibility in locating annotation files for COCO dataset evaluation.

πŸ“Š Key Changes

  • Added a check to determine if the default COCO annotation file path exists.
  • If the default path is not found, the code now looks for the annotation file within a directory specified in the dataset configuration.

🎯 Purpose & Impact

  • Purpose: The change ensures that the evaluation script can adapt to different file structures, making it easier for users to use custom paths for their datasets without manual code modifications.
  • Impact: Users with non-standard dataset installations can now run evaluations without encountering file not found errors, streamlining the validation process of object detection models trained with YOLOv5. πŸ”„πŸ’‘

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 @malashinroman, thank you for submitting a YOLOv5 πŸš€ PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • βœ… Verify your PR is up-to-date with ultralytics/yolov5 master branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • βœ… Verify all YOLOv5 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 glenn-jocher merged commit 52d9622 into ultralytics:master Jul 23, 2023
10 checks passed
@glenn-jocher
Copy link
Member

@malashinroman thanks for the PR!

pleb631 pushed a commit to pleb631/yolov5 that referenced this pull request Jan 6, 2024
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.

None yet

2 participants