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: