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 yolo11 and ultralytics obb task support #1109

Merged
merged 18 commits into from
Dec 16, 2024
Merged

add yolo11 and ultralytics obb task support #1109

merged 18 commits into from
Dec 16, 2024

Conversation

fcakyon
Copy link
Collaborator

@fcakyon fcakyon commented Dec 16, 2024

  • 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.
  • 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.
  • 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.
  • 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.
  • 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.

This change enhances compatibility with the Ultralytics YOLO framework and streamlines the detection model architecture.

fcakyon and others added 10 commits December 16, 2024 16:15
…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.
@fcakyon fcakyon self-assigned this Dec 16, 2024
- 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 fcakyon changed the title add yolo11 support add yolo11 and ultralytics obb task support Dec 16, 2024
@fcakyon fcakyon merged commit 4784b77 into main Dec 16, 2024
9 checks passed
@fcakyon fcakyon deleted the yolo11 branch December 16, 2024 17:06
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.

1 participant