ultralytics 8.3.12 SAM and SAM2 multi-point prompts (#16643)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
1c4d788aa1
commit
b89d6f4070
6 changed files with 79 additions and 13 deletions
|
|
@ -97,9 +97,12 @@ def test_mobilesam():
|
|||
# Source
|
||||
source = ASSETS / "zidane.jpg"
|
||||
|
||||
# Predict a segment based on a point prompt
|
||||
# Predict a segment based on a 1D point prompt and 1D labels.
|
||||
model.predict(source, points=[900, 370], labels=[1])
|
||||
|
||||
# Predict a segment based on 3D points and 2D labels (multiple points per object).
|
||||
model.predict(source, points=[[[900, 370], [1000, 100]]], labels=[[1, 1]])
|
||||
|
||||
# Predict a segment based on a box prompt
|
||||
model.predict(source, bboxes=[439, 437, 524, 709], save=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue