Add FastSAM and YOLO-World tracking docs (#10733)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Muhammad Rizwan Munawar 2024-05-01 18:55:12 +05:00 committed by GitHub
parent bc9fd45cdf
commit 15060e13cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 6 deletions

View file

@ -119,6 +119,30 @@ Validation of the model on a dataset can be done as follows:
Please note that FastSAM only supports detection and segmentation of a single class of object. This means it will recognize and segment all objects as the same class. Therefore, when preparing the dataset, you need to convert all object category IDs to 0.
### Track Usage
To perform object tracking on an image, use the `track` method as shown below:
!!! Example
=== "Python"
```python
from ultralytics import FastSAM
# Create a FastSAM model
model = FastSAM('FastSAM-s.pt') # or FastSAM-x.pt
# Track with a FastSAM model on a video
results = model.track(source="path/to/video.mp4", imgsz=640)
```
=== "CLI"
```bash
yolo segment track model=FastSAM-s.pt source="path/to/video/file.mp4" imgsz=640
```
## FastSAM official Usage
FastSAM is also available directly from the [https://github.com/CASIA-IVA-Lab/FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) repository. Here is a brief overview of the typical steps you might take to use FastSAM:

View file

@ -152,6 +152,31 @@ Model validation on a dataset is streamlined as follows:
yolo val model=yolov8s-world.pt data=coco8.yaml imgsz=640
```
### Track Usage
Object tracking with YOLO-World model on a video/images is streamlined as follows:
!!! Example
=== "Python"
```python
from ultralytics import YOLO
# Create a YOLO-World model
model = YOLO('yolov8s-world.pt') # or select yolov8m/l-world.pt for different sizes
# Track with a YOLO-World model on a video
results = model.track(source="path/to/video.mp4")
```
=== "CLI"
```bash
# Track with a YOLO-World model on the video with a specified image size
yolo track model=yolov8s-world.pt imgsz=640 source="path/to/video/file.mp4"
```
!!! Note
The YOLO-World models provided by Ultralytics come pre-configured with [COCO dataset](../datasets/detect/coco.md) categories as part of their offline vocabulary, enhancing efficiency for immediate application. This integration allows the YOLOv8-World models to directly recognize and predict the 80 standard categories defined in the COCO dataset without requiring additional setup or customization.