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

Ease of code integration/expansion #9095

Closed
1 of 2 tasks
Xonxt opened this issue Mar 19, 2024 · 4 comments
Closed
1 of 2 tasks

Ease of code integration/expansion #9095

Xonxt opened this issue Mar 19, 2024 · 4 comments
Labels
enhancement New feature or request Stale Stale and schedule for closing soon

Comments

@Xonxt
Copy link

Xonxt commented Mar 19, 2024

Search before asking

  • I have searched the YOLOv8 issues and found no similar feature requests.

Description

There are multiple examples in this repository, where trying to add some custom features results in having to copy-and-paste a lot of boiler-plate code just to change one single line.

Example 1:
At my Institute we use our proprietary JSON-based dataset annotation format. Creating a new dataset class, that inherits from YOLODataset or the BaseDataset is no problem. But then, when we run validation, it has a check where if the path to the dataset doesn't end with ".yaml" extension, it will throw an exception:

So now I have to create a new "Validator" class, that inherits from the base class, copy and paste the entire call() method verbatim, just to comment out this "yaml" extension check, or add another elif statement to check for "json".

Example 2:
Maybe I want to add some custom training parameters, for example, to control how strong the blur augmentation is on the training dataset. But I cannot add them directly to the args, because the Trainer class will call get_cfg() method to check the arguments, which will throw an exception when it encounters any extra parameters.

Why? Why does it need to throw an exception? Just ignore them and move on, I would take care of handling them myself.
But instead now I need to create an entire new Trainer class, that inherits from the base class, copy the entire constructor verbatim, and make it call a different "get_cfg" function, which is also copied verbatim, except for one change: don't throw an exception if an unknown parameter is encountered.

Use case

Make it easier to expand the original repository when adding custom features, custom dataset types, custom augmentations, etc.

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@Xonxt Xonxt added the enhancement New feature or request label Mar 19, 2024
@glenn-jocher
Copy link
Member

@Xonxt hello! Thanks for sharing your insights on expanding the original repository with custom features – it's feedback like this that helps us improve. 👍

I understand your concerns regarding the need to duplicate code for seemingly minor modifications. We strive to make YOLOv8 as user-friendly and extendable as possible, and we recognize there's always room for improvement.

For integrating custom JSON-based datasets, a potential workaround without overriding the validator could involve creating a .yaml file that points to your JSON configuration, essentially serving as a bridge. However, your suggestion to better accommodate various dataset formats is noted and appreciated.

Regarding adding custom training parameters, I understand the frustration with strict argument checking. We'll consider making argument parsing more flexible in future iterations, allowing for a smoother incorporation of custom parameters without substantial class overrides.

For now, please feel free to bypass the strict checks by modifying your local copy as needed. We also encourage contributions, so even though you mentioned not submitting a PR, if you ever change your mind, we'd be happy to review enhancements that address these issues.

Thanks again for your feedback, and please continue to share any more insights or suggestions you might have! 🚀

@Bhavay-2001
Copy link

Hi @glenn-jocher, I would like to work on this if it is beginner friendly.
Thanks

@glenn-jocher
Copy link
Member

@Bhavay-2001 hi! That sounds great, and we appreciate your willingness to contribute! 😊 This task can definitely be a good start for beginners, and you'll have the support of the community. If you need any specific pointers or have questions as you go along, feel free to ask. Happy coding! 🚀

Copy link

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Apr 20, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

3 participants