-
Notifications
You must be signed in to change notification settings - Fork 608
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 yolo11 and ultralytics obb task support #1109
Merged
Conversation
This file contains 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
…pts, including Detectron2, MMDetection, TorchVision, and YOLOv5 models, as well as the predict_batch script. This cleanup enhances code maintainability and focuses on supported models.
- Updated model type mapping to include 'ultralytics' for YOLO models. - Introduced a new `UltralyticsDetectionModel` class for handling Ultralytics models. - Refactored `RTDetrDetectionModel` to inherit from `UltralyticsDetectionModel`. - Removed unused imports and adjusted test cases to utilize the new model class. - Added support for Ultralytics model names in the auto model configuration. This change enhances compatibility with the Ultralytics YOLO framework and streamlines the detection model architecture.
- Added 'ultralytics' to the model type mapping in `auto_model.py`. - Reordered import statements in `__init__.py` for clarity. - Integrated `click` for improved console output in `utils.py`. - Enhanced failure messages and provided formatting instructions in `validate_and_exit` function. These changes improve the organization of model imports and enhance user feedback during script execution.
- Updated the `ultralytics` package version in `README.md` and CI workflows to 8.3.50. - Incremented the version number in `sahi/__init__.py` to 0.11.20. - Introduced a new utility file `sahi/utils/ultralytics.py` for downloading YOLOv8 and YOLO11 models. - Removed the deprecated `sahi/utils/yolov8.py` file. - Updated test files to utilize the new model utilities and ensure compatibility with the latest changes. These updates improve the integration with the Ultralytics framework and streamline model management.
- Added blank lines for better readability in `sahi/utils/ultralytics.py`. - Standardized string quotes from single to double in the `download_file` function and test cases for consistency. - Updated import statements in `tests/test_ultralyticsmodel.py` for improved organization. These changes enhance code clarity and maintainability while ensuring consistent coding style across the utility and test files.
- Introduced tests for YOLO11 model predictions in `test_predict.py`, including both full-sized and sliced predictions. - Implemented model initialization and image preparation for testing. - Added assertions to verify the detection results for different object categories (person, truck, car). - Enhanced the test suite to ensure compatibility with the new Ultralytics model utilities. These additions improve the coverage of the testing framework for the Ultralytics YOLO11 model and ensure accurate prediction functionality.
- Updated README.md to include a new walkthrough for YOLO11 with SAHI, enhancing documentation for users. - Added a new Jupyter notebook `inference_for_ultralytics.ipynb` for performing inference using YOLO11 and SAHI, including installation instructions, model setup, and example predictions. These changes improve user guidance and provide practical examples for utilizing the YOLO11 model with SAHI.
- Consolidated parameters in the `get_prediction` function call for cleaner code. - Moved the import statement for `Yolov5TestConstants` and `download_yolov5n_model` to enhance module organization. These changes enhance the clarity and maintainability of the test suite for YOLO11 model predictions.
- Revised the README.md to include support for Ultralytics YOLOv8, YOLOv10, and YOLOv11 models, replacing the previous YOLOv5 reference. - Updated links to the relevant model documentation and adjusted references to the DetectionModel class and wrappers for consistency with the new model utilities. These changes enhance the documentation to better guide users in utilizing the latest YOLO models with the SAHI library.
… related models - Modified the unit test job names in both `ci.yml` and `package_testing.yml` to include references to YOLO11, RTDETR, MMDET, HuggingFace, and Torchvision, replacing the previous YOLOv5 and Detectron2 mentions. - These updates ensure that the CI workflows accurately represent the current testing framework and supported models.
… OBB support - Enhanced type hinting in `annotation.py` for better code clarity and type safety. - Introduced support for Oriented Bounding Boxes (OBB) in the `UltralyticsDetectionModel`, including new methods for handling OBB points and converting them to COCO segmentation format. - Updated the `cv.py` utility to include a function for converting OBB points to COCO format. - Adjusted unit tests to verify OBB predictions and ensure proper functionality of the updated model utilities. These changes improve the maintainability and usability of the SAHI library with the latest Ultralytics models.
…dling - Reintroduced the import of `ObjectPrediction` in `base.py` for better modularity. - Improved code readability in `ultralytics.py` by restructuring the concatenation of OBB data and resizing masks. - Cleaned up whitespace in `cv.py` to enhance code clarity in the OBB to COCO conversion function. These changes contribute to a more maintainable and user-friendly codebase for the SAHI library's Ultralytics model integration.
- Deleted `test_yolov8model.py` as it is no longer needed following recent refactoring and updates to the testing framework. - This cleanup contributes to a more streamlined and maintainable codebase for the SAHI library's Ultralytics model integration.
fcakyon
changed the title
add yolo11 support
add yolo11 and ultralytics obb task support
Dec 16, 2024
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.
annotation.py
for better code clarity and type safety.UltralyticsDetectionModel
, including new methods for handling OBB points and converting them to COCO segmentation format.cv.py
utility to include a function for converting OBB points to COCO format.UltralyticsDetectionModel
class for handling Ultralytics models.RTDetrDetectionModel
to inherit fromUltralyticsDetectionModel
.ultralytics
package version inREADME.md
and CI workflows to 8.3.50.sahi/__init__.py
to 0.11.20.sahi/utils/ultralytics.py
for downloading YOLOv8 and YOLO11 models.sahi/utils/yolov8.py
file.test_predict.py
, including both full-sized and sliced predictions.inference_for_ultralytics.ipynb
for performing inference using YOLO11 and SAHI, including installation instructions, model setup, and example predictions.This change enhances compatibility with the Ultralytics YOLO framework and streamlines the detection model architecture.