Add Quickstart Docs YouTube video (#5733)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2023-10-16 12:17:16 +02:00 committed by GitHub
parent cedce60f8c
commit 437b4306d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 15 deletions

View file

@ -61,15 +61,14 @@ class SAM(Model):
Performs segmentation prediction on the given image or video source.
Args:
source: Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object.
source (str): Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object.
stream (bool, optional): If True, enables real-time streaming. Defaults to False.
bboxes (list, optional): List of bounding box coordinates for prompted segmentation. Defaults to None.
points (list, optional): List of points for prompted segmentation. Defaults to None.
labels (list, optional): List of labels for prompted segmentation. Defaults to None.
**kwargs: Additional keyword arguments.
Returns:
The segmentation masks.
(list): The model predictions.
"""
overrides = dict(conf=0.25, task='segment', mode='predict', imgsz=1024)
kwargs.update(overrides)
@ -81,15 +80,14 @@ class SAM(Model):
Alias for the 'predict' method.
Args:
source: Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object.
source (str): Path to the image or video file, or a PIL.Image object, or a numpy.ndarray object.
stream (bool, optional): If True, enables real-time streaming. Defaults to False.
bboxes (list, optional): List of bounding box coordinates for prompted segmentation. Defaults to None.
points (list, optional): List of points for prompted segmentation. Defaults to None.
labels (list, optional): List of labels for prompted segmentation. Defaults to None.
**kwargs: Additional keyword arguments.
Returns:
The segmentation masks.
(list): The model predictions.
"""
return self.predict(source, stream, bboxes, points, labels, **kwargs)
@ -112,6 +110,6 @@ class SAM(Model):
Provides a mapping from the 'segment' task to its corresponding 'Predictor'.
Returns:
dict: A dictionary mapping the 'segment' task to its corresponding 'Predictor'.
(dict): A dictionary mapping the 'segment' task to its corresponding 'Predictor'.
"""
return {'segment': {'predictor': Predictor}}