Update SAHI example from YOLOv8 to YOLO11 (#18276)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
a3d807be13
commit
ce50e33fa4
4 changed files with 39 additions and 32 deletions
|
|
@ -1,11 +1,11 @@
|
|||
# YOLOv8 with SAHI (Inference on Video)
|
||||
# YOLO11 with SAHI (Inference on Video)
|
||||
|
||||
[SAHI](https://docs.ultralytics.com/guides/sahi-tiled-inference/) is designed to optimize object detection algorithms for large-scale and high-resolution imagery. It partitions images into manageable slices, performs object detection on each slice, and then stitches the results back together. This tutorial will guide you through the process of running YOLOv8 inference on video files with the aid of SAHI.
|
||||
[SAHI](https://docs.ultralytics.com/guides/sahi-tiled-inference/) is designed to optimize object detection algorithms for large-scale and high-resolution imagery. It partitions images into manageable slices, performs object detection on each slice, and then stitches the results back together. This tutorial will guide you through the process of running YOLO11 inference on video files with the aid of SAHI.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Step 1: Install the Required Libraries](#step-1-install-the-required-libraries)
|
||||
- [Step 2: Run the Inference with SAHI using Ultralytics YOLOv8](#step-2-run-the-inference-with-sahi-using-ultralytics-yolov8)
|
||||
- [Step 2: Run the Inference with SAHI using Ultralytics YOLO11](#step-2-run-the-inference-with-sahi-using-ultralytics-yolo11)
|
||||
- [Usage Options](#usage-options)
|
||||
- [FAQ](#faq)
|
||||
|
||||
|
|
@ -18,13 +18,13 @@ Clone the repository, install dependencies and `cd` to this local directory for
|
|||
git clone https://github.com/ultralytics/ultralytics
|
||||
|
||||
# Install dependencies
|
||||
pip install sahi ultralytics
|
||||
pip install -U sahi ultralytics
|
||||
|
||||
# cd to local directory
|
||||
cd ultralytics/examples/YOLOv8-SAHI-Inference-Video
|
||||
```
|
||||
|
||||
## Step 2: Run the Inference with SAHI using Ultralytics YOLOv8
|
||||
## Step 2: Run the Inference with SAHI using Ultralytics YOLO11
|
||||
|
||||
Here are the basic commands for running the inference:
|
||||
|
||||
|
|
@ -33,14 +33,14 @@ Here are the basic commands for running the inference:
|
|||
python yolov8_sahi.py --source "path/to/video.mp4" --save-img
|
||||
|
||||
#if you want to change model file
|
||||
python yolov8_sahi.py --source "path/to/video.mp4" --save-img --weights "yolov8n.pt"
|
||||
python yolov8_sahi.py --source "path/to/video.mp4" --save-img --weights "yolo11n.pt"
|
||||
```
|
||||
|
||||
## Usage Options
|
||||
|
||||
- `--source`: Specifies the path to the video file you want to run inference on.
|
||||
- `--save-img`: Flag to save the detection results as images.
|
||||
- `--weights`: Specifies a different YOLOv8 model file (e.g., `yolov8n.pt`, `yolov8s.pt`, `yolov8m.pt`, `yolov8l.pt`, `yolov8x.pt`).
|
||||
- `--weights`: Specifies a different YOLO11 model file (e.g., `yolo11n.pt`, `yolov8s.pt`, `yolo11m.pt`, `yolo11l.pt`, `yolo11x.pt`).
|
||||
|
||||
## FAQ
|
||||
|
||||
|
|
@ -48,9 +48,9 @@ python yolov8_sahi.py --source "path/to/video.mp4" --save-img --weights "yolov8n
|
|||
|
||||
SAHI stands for Slicing Aided Hyper Inference. It is a library designed to optimize object detection algorithms for large-scale and high-resolution images. The library source code is available on [GitHub](https://github.com/obss/sahi).
|
||||
|
||||
**2. Why use SAHI with YOLOv8?**
|
||||
**2. Why use SAHI with YOLO11?**
|
||||
|
||||
SAHI can handle large-scale images by slicing them into smaller, more manageable sizes without compromising the detection quality. This makes it a great companion to YOLOv8, especially when working with high-resolution videos.
|
||||
SAHI can handle large-scale images by slicing them into smaller, more manageable sizes without compromising the detection quality. This makes it a great companion to YOLO11, especially when working with high-resolution videos.
|
||||
|
||||
**3. How do I debug issues?**
|
||||
|
||||
|
|
@ -66,4 +66,4 @@ Yes, you can specify different YOLO model weights using the `--weights` option.
|
|||
|
||||
**5. Where can I find more information?**
|
||||
|
||||
For a full guide to YOLOv8 with SAHI see [https://docs.ultralytics.com/guides/sahi-tiled-inference](https://docs.ultralytics.com/guides/sahi-tiled-inference/).
|
||||
For a full guide to YOLO11 with SAHI see [https://docs.ultralytics.com/guides/sahi-tiled-inference](https://docs.ultralytics.com/guides/sahi-tiled-inference/).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue