Reference for ultralytics/models/fastsam/model.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/model.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.fastsam.model.FastSAM
Bases: Model
FastSAM model interface.
Example
Source code in ultralytics/models/fastsam/model.py
task_map
property
Returns a dictionary mapping segment task to corresponding predictor and validator classes.
predict
Perform segmentation prediction on image or video source.
Supports prompted segmentation with bounding boxes, points, labels, and texts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str | Image | ndarray
|
Input source. |
required |
stream
|
bool
|
Enable real-time streaming. |
False
|
bboxes
|
list
|
Bounding box coordinates for prompted segmentation. |
None
|
points
|
list
|
Points for prompted segmentation. |
None
|
labels
|
list
|
Labels for prompted segmentation. |
None
|
texts
|
list
|
Texts for prompted segmentation. |
None
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
list
|
Model predictions. |
Source code in ultralytics/models/fastsam/model.py
📅 Created 1 year ago
✏️ Updated 3 months ago