Back to Ultralytics

Sam Auto Annotate

docs/macros/sam-auto-annotate.md

8.4.461.6 KB
Original Source
ArgumentTypeDefaultDescription
datastrrequiredPath to directory containing target images for annotation or segmentation.
det_modelstr'yolo26x.pt'YOLO detection model path for initial object detection.
sam_modelstr'sam_b.pt'SAM model path for segmentation (supports SAM, SAM2 variants, and MobileSAM models).
devicestr''Computation device (e.g., 'cuda:0', 'cpu', or '' for automatic device detection).
conffloat0.25YOLO detection confidence threshold for filtering weak detections.
ioufloat0.45IoU threshold for Non-Maximum Suppression to filter overlapping boxes.
imgszint640Input size for resizing images (must be multiple of 32).
max_detint300Maximum number of detections per image for memory efficiency.
classeslist[int]NoneList of class indices to detect (e.g., [0, 1] for person & bicycle).
output_dirstrNoneSave directory for annotations (defaults to './labels' relative to data path).