In [1]불러오기·전체 분할
from ultralytics import FastSAM
model = FastSAM("models/FastSAM-s.pt")
results = model("images/test_image.jpg", conf=0.7) # 신뢰도 0.7 이상만
masks = results[0].masks
print(len(masks))
Out[1] 출력 보기
image 1/1 ...\images\test_image.jpg: 384x640 29 objects, 106.1ms 29