Update YOLO11 Actions and Docs (#16596)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
51e93d6111
commit
97f38409fb
124 changed files with 1948 additions and 1948 deletions
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
comments: true
|
||||
description: Learn how to implement YOLOv8 with SAHI for sliced inference. Optimize memory usage and enhance detection accuracy for large-scale applications.
|
||||
keywords: YOLOv8, SAHI, Sliced Inference, Object Detection, Ultralytics, High-resolution Images, Computational Efficiency, Integration Guide
|
||||
description: Learn how to implement YOLO11 with SAHI for sliced inference. Optimize memory usage and enhance detection accuracy for large-scale applications.
|
||||
keywords: YOLO11, SAHI, Sliced Inference, Object Detection, Ultralytics, High-resolution Images, Computational Efficiency, Integration Guide
|
||||
---
|
||||
|
||||
# Ultralytics Docs: Using YOLOv8 with SAHI for Sliced Inference
|
||||
# Ultralytics Docs: Using YOLO11 with SAHI for Sliced Inference
|
||||
|
||||
Welcome to the Ultralytics documentation on how to use YOLOv8 with [SAHI](https://github.com/obss/sahi) (Slicing Aided Hyper Inference). This comprehensive guide aims to furnish you with all the essential knowledge you'll need to implement SAHI alongside YOLOv8. We'll deep-dive into what SAHI is, why sliced inference is critical for large-scale applications, and how to integrate these functionalities with YOLOv8 for enhanced [object detection](https://www.ultralytics.com/glossary/object-detection) performance.
|
||||
Welcome to the Ultralytics documentation on how to use YOLO11 with [SAHI](https://github.com/obss/sahi) (Slicing Aided Hyper Inference). This comprehensive guide aims to furnish you with all the essential knowledge you'll need to implement SAHI alongside YOLO11. We'll deep-dive into what SAHI is, why sliced inference is critical for large-scale applications, and how to integrate these functionalities with YOLO11 for enhanced [object detection](https://www.ultralytics.com/glossary/object-detection) performance.
|
||||
|
||||
<p align="center">
|
||||
<img width="1024" src="https://github.com/ultralytics/docs/releases/download/0/sahi-sliced-inference-overview.avif" alt="SAHI Sliced Inference Overview">
|
||||
|
|
@ -24,7 +24,7 @@ SAHI (Slicing Aided Hyper Inference) is an innovative library designed to optimi
|
|||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>Watch:</strong> Inference with SAHI (Slicing Aided Hyper Inference) using Ultralytics YOLOv8
|
||||
<strong>Watch:</strong> Inference with SAHI (Slicing Aided Hyper Inference) using Ultralytics YOLO11
|
||||
</p>
|
||||
|
||||
### Key Features of SAHI
|
||||
|
|
@ -47,12 +47,12 @@ Sliced Inference refers to the practice of subdividing a large or high-resolutio
|
|||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<th>YOLOv8 without SAHI</th>
|
||||
<th>YOLOv8 with SAHI</th>
|
||||
<th>YOLO11 without SAHI</th>
|
||||
<th>YOLO11 with SAHI</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://github.com/ultralytics/docs/releases/download/0/yolov8-without-sahi.avif" alt="YOLOv8 without SAHI" width="640"></td>
|
||||
<td><img src="https://github.com/ultralytics/docs/releases/download/0/yolov8-with-sahi.avif" alt="YOLOv8 with SAHI" width="640"></td>
|
||||
<td><img src="https://github.com/ultralytics/docs/releases/download/0/yolov8-without-sahi.avif" alt="YOLO11 without SAHI" width="640"></td>
|
||||
<td><img src="https://github.com/ultralytics/docs/releases/download/0/yolov8-with-sahi.avif" alt="YOLO11 with SAHI" width="640"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
@ -68,15 +68,15 @@ pip install -U ultralytics sahi
|
|||
|
||||
### Import Modules and Download Resources
|
||||
|
||||
Here's how to import the necessary modules and download a YOLOv8 model and some test images:
|
||||
Here's how to import the necessary modules and download a YOLO11 model and some test images:
|
||||
|
||||
```python
|
||||
from sahi.utils.file import download_from_url
|
||||
from sahi.utils.yolov8 import download_yolov8s_model
|
||||
|
||||
# Download YOLOv8 model
|
||||
yolov8_model_path = "models/yolov8s.pt"
|
||||
download_yolov8s_model(yolov8_model_path)
|
||||
# Download YOLO11 model
|
||||
model_path = "models/yolo11s.pt"
|
||||
download_yolov8s_model(model_path)
|
||||
|
||||
# Download test images
|
||||
download_from_url(
|
||||
|
|
@ -89,11 +89,11 @@ download_from_url(
|
|||
)
|
||||
```
|
||||
|
||||
## Standard Inference with YOLOv8
|
||||
## Standard Inference with YOLO11
|
||||
|
||||
### Instantiate the Model
|
||||
|
||||
You can instantiate a YOLOv8 model for object detection like this:
|
||||
You can instantiate a YOLO11 model for object detection like this:
|
||||
|
||||
```python
|
||||
from sahi import AutoDetectionModel
|
||||
|
|
@ -129,7 +129,7 @@ result.export_visuals(export_dir="demo_data/")
|
|||
Image("demo_data/prediction_visual.png")
|
||||
```
|
||||
|
||||
## Sliced Inference with YOLOv8
|
||||
## Sliced Inference with YOLO11
|
||||
|
||||
Perform sliced inference by specifying the slice dimensions and overlap ratios:
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ from sahi.predict import predict
|
|||
|
||||
predict(
|
||||
model_type="yolov8",
|
||||
model_path="path/to/yolov8n.pt",
|
||||
model_path="path/to/yolo11n.pt",
|
||||
model_device="cpu", # or 'cuda:0'
|
||||
model_confidence_threshold=0.4,
|
||||
source="path/to/dir",
|
||||
|
|
@ -181,7 +181,7 @@ predict(
|
|||
)
|
||||
```
|
||||
|
||||
That's it! Now you're equipped to use YOLOv8 with SAHI for both standard and sliced inference.
|
||||
That's it! Now you're equipped to use YOLO11 with SAHI for both standard and sliced inference.
|
||||
|
||||
## Citations and Acknowledgments
|
||||
|
||||
|
|
@ -206,23 +206,23 @@ We extend our thanks to the SAHI research group for creating and maintaining thi
|
|||
|
||||
## FAQ
|
||||
|
||||
### How can I integrate YOLOv8 with SAHI for sliced inference in object detection?
|
||||
### How can I integrate YOLO11 with SAHI for sliced inference in object detection?
|
||||
|
||||
Integrating Ultralytics YOLOv8 with SAHI (Slicing Aided Hyper Inference) for sliced inference optimizes your object detection tasks on high-resolution images by partitioning them into manageable slices. This approach improves memory usage and ensures high detection accuracy. To get started, you need to install the ultralytics and sahi libraries:
|
||||
Integrating Ultralytics YOLO11 with SAHI (Slicing Aided Hyper Inference) for sliced inference optimizes your object detection tasks on high-resolution images by partitioning them into manageable slices. This approach improves memory usage and ensures high detection accuracy. To get started, you need to install the ultralytics and sahi libraries:
|
||||
|
||||
```bash
|
||||
pip install -U ultralytics sahi
|
||||
```
|
||||
|
||||
Then, download a YOLOv8 model and test images:
|
||||
Then, download a YOLO11 model and test images:
|
||||
|
||||
```python
|
||||
from sahi.utils.file import download_from_url
|
||||
from sahi.utils.yolov8 import download_yolov8s_model
|
||||
|
||||
# Download YOLOv8 model
|
||||
yolov8_model_path = "models/yolov8s.pt"
|
||||
download_yolov8s_model(yolov8_model_path)
|
||||
# Download YOLO11 model
|
||||
model_path = "models/yolo11s.pt"
|
||||
download_yolov8s_model(model_path)
|
||||
|
||||
# Download test images
|
||||
download_from_url(
|
||||
|
|
@ -231,11 +231,11 @@ download_from_url(
|
|||
)
|
||||
```
|
||||
|
||||
For more detailed instructions, refer to our [Sliced Inference guide](#sliced-inference-with-yolov8).
|
||||
For more detailed instructions, refer to our [Sliced Inference guide](#sliced-inference-with-yolo11).
|
||||
|
||||
### Why should I use SAHI with YOLOv8 for object detection on large images?
|
||||
### Why should I use SAHI with YOLO11 for object detection on large images?
|
||||
|
||||
Using SAHI with Ultralytics YOLOv8 for object detection on large images offers several benefits:
|
||||
Using SAHI with Ultralytics YOLO11 for object detection on large images offers several benefits:
|
||||
|
||||
- **Reduced Computational Burden**: Smaller slices are faster to process and consume less memory, making it feasible to run high-quality detections on hardware with limited resources.
|
||||
- **Maintained Detection Accuracy**: SAHI uses intelligent algorithms to merge overlapping boxes, preserving the detection quality.
|
||||
|
|
@ -243,9 +243,9 @@ Using SAHI with Ultralytics YOLOv8 for object detection on large images offers s
|
|||
|
||||
Learn more about the [benefits of sliced inference](#benefits-of-sliced-inference) in our documentation.
|
||||
|
||||
### Can I visualize prediction results when using YOLOv8 with SAHI?
|
||||
### Can I visualize prediction results when using YOLO11 with SAHI?
|
||||
|
||||
Yes, you can visualize prediction results when using YOLOv8 with SAHI. Here's how you can export and visualize the results:
|
||||
Yes, you can visualize prediction results when using YOLO11 with SAHI. Here's how you can export and visualize the results:
|
||||
|
||||
```python
|
||||
from IPython.display import Image
|
||||
|
|
@ -256,9 +256,9 @@ Image("demo_data/prediction_visual.png")
|
|||
|
||||
This command will save the visualized predictions to the specified directory and you can then load the image to view it in your notebook or application. For a detailed guide, check out the [Standard Inference section](#visualize-results).
|
||||
|
||||
### What features does SAHI offer for improving YOLOv8 object detection?
|
||||
### What features does SAHI offer for improving YOLO11 object detection?
|
||||
|
||||
SAHI (Slicing Aided Hyper Inference) offers several features that complement Ultralytics YOLOv8 for object detection:
|
||||
SAHI (Slicing Aided Hyper Inference) offers several features that complement Ultralytics YOLO11 for object detection:
|
||||
|
||||
- **Seamless Integration**: SAHI easily integrates with YOLO models, requiring minimal code adjustments.
|
||||
- **Resource Efficiency**: It partitions large images into smaller slices, which optimizes memory usage and speed.
|
||||
|
|
@ -266,9 +266,9 @@ SAHI (Slicing Aided Hyper Inference) offers several features that complement Ult
|
|||
|
||||
For a deeper understanding, read about SAHI's [key features](#key-features-of-sahi).
|
||||
|
||||
### How do I handle large-scale inference projects using YOLOv8 and SAHI?
|
||||
### How do I handle large-scale inference projects using YOLO11 and SAHI?
|
||||
|
||||
To handle large-scale inference projects using YOLOv8 and SAHI, follow these best practices:
|
||||
To handle large-scale inference projects using YOLO11 and SAHI, follow these best practices:
|
||||
|
||||
1. **Install Required Libraries**: Ensure that you have the latest versions of ultralytics and sahi.
|
||||
2. **Configure Sliced Inference**: Determine the optimal slice dimensions and overlap ratios for your specific project.
|
||||
|
|
@ -281,7 +281,7 @@ from sahi.predict import predict
|
|||
|
||||
predict(
|
||||
model_type="yolov8",
|
||||
model_path="path/to/yolov8n.pt",
|
||||
model_path="path/to/yolo11n.pt",
|
||||
model_device="cpu", # or 'cuda:0'
|
||||
model_confidence_threshold=0.4,
|
||||
source="path/to/dir",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue