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

Updated validator.py #9365

Closed
wants to merge 1 commit into from
Closed

Conversation

Bhavay-2001
Copy link

@Bhavay-2001 Bhavay-2001 commented Mar 27, 2024

Initial PR for the proposed changes. Will be requiring some help for the necessary changes.

@glenn-jocher @Burhan-Q

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced data format support in model validation πŸš€

πŸ“Š Key Changes

  • Added JSON support for data files in model validating process.

🎯 Purpose & Impact

  • Flexibility: Users can now utilize JSON files for their datasets, in addition to YAML and YML formats. This expands the range of dataset formats the validator can process.
  • Ease of Use: This change makes the tool more accessible to users who prefer JSON, potentially simplifying their workflow and making data preparation easier.
  • Broader Impact: By supporting a more widely-used format like JSON, more developers and researchers can leverage Ultralytics tools for their projects without needing to convert their datasets.

Copy link

github-actions bot commented Mar 27, 2024

CLA Assistant Lite bot All Contributors have signed the CLA. βœ…

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 76.92%. Comparing base (9094394) to head (201ce54).
Report is 53 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9365      +/-   ##
==========================================
+ Coverage   75.91%   76.92%   +1.00%     
==========================================
  Files         117      117              
  Lines       14822    14859      +37     
==========================================
+ Hits        11252    11430     +178     
+ Misses       3570     3429     -141     
Flag Coverage Ξ”
Benchmarks 36.57% <100.00%> (-0.27%) ⬇️
GPU 38.84% <100.00%> (-0.04%) ⬇️
Tests 72.08% <100.00%> (+1.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@Bhavay-2001
Copy link
Author

I have read the CLA Document and I sign the CLA

@Burhan-Q
Copy link
Member

@Bhavay-2001 forgive me, I don't see a benefit here. We've standardized around YAML so what's the justification to include JSON? The case needs to be pretty strong as it will introduce additional confusion and complexity on the side of Ultralytics.

@Bhavay-2001
Copy link
Author

Hi @Burhan-Q, in the issue the user is facing issue to load a json type dataset. He suggested an initial approach based on which I added the code. How can we modify it such that the users are able to load json type dataset as well?

@Bhavay-2001
Copy link
Author

Hi @glenn-jocher @Burhan-Q, please let me know how can I add feature for working with json datasets as well as requested in the issue.
Thanks

@glenn-jocher
Copy link
Member

@Bhavay-2001 hi there! Thanks for your interest in contributing to enhance YOLOv8's functionality with JSON datasets. πŸš€

To support JSON datasets, you'll primarily need to modify the data loading and parsing components to accommodate JSON format. Here's a sketch of what this might look like:

  1. Detect File Format: In the data loader, detect whether the dataset file is JSON or YAML based on the file extension.
  2. Parse JSON: If it's a JSON file, use Python's json module to load and parse the JSON data.
import json

# Assuming 'data.json' is your dataset file
with open('data.json', 'r') as file:
    data = json.load(file)
  1. Adjust Data Handling: Ensure the rest of your data handling logic can work with the data structure loaded from JSON, which might be slightly different from YAML.

Remember to thoroughly test with a few JSON dataset examples to ensure compatibility and correct functionality.

Feel free to submit a PR with your proposed changes, and we'll be happy to review it. Thanks for helping us improve YOLOv8! πŸ™Œ

@Bhavay-2001
Copy link
Author

Please refer to #10206. Discussions will be there. This will be closed.
Thanks

@glenn-jocher
Copy link
Member

@Bhavay-2001 sure, I'll move the conversation to #10206 and continue our discussion there. Closing this one as per your direction. Thanks! πŸš€

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

3 participants