Add YOLO architecture#140
Open
rojberr wants to merge 5 commits into
Open
Conversation
Collaborator
Author
|
GIT Conflict ;) Let me know if you want to do it together ^^ |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for the YOLO classifier architecture into the project by updating the model factory, classifier module, main initialization, and configuration files.
- Added YOLO model loading and classifier head replacement in the model factory.
- Updated the classifier module and main script to use the new YOLO model structure.
- Adjusted configuration settings to reflect the new model and hyperparameter values.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/models/model_factory.py | Added YOLO model loading, dummy input generation, and classifier head replacement. |
| src/models/classifier_module.py | Updated import and optimizer configuration for YOLO models versus other models. |
| src/main.py | Modified instantiation and logging to support the new classifier module alias. |
| src/dataset_functions.py | Removed an extraneous newline to improve code cleanliness. |
| src/config.yaml | Updated model name and learning rate to match the new YOLO classifier implementation. |
Comments suppressed due to low confidence (2)
src/models/model_factory.py:62
- Assigning arbitrary attributes (f, i, type) to new_head may lead to confusion; consider adding inline comments or refactoring this into a dedicated classifier head subclass to clarify its purpose.
new_head.f = -1
src/models/classifier_module.py:82
- [nitpick] Consider using a more explicit check (e.g. if self.name == "YOLO_cls") to avoid potential false positives when matching model names.
if self.name.startswith("YOLO"):
|
|
||
| def create_model(model_name, num_classes, freeze=False): | ||
| if model_name == "resnet18": | ||
| '''if model_name == "resnet18": |
There was a problem hiding this comment.
Consider removing the deprecated commented-out block if it is no longer needed to improve code readability and maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.