🟠 Large Model Prompt Segmentation
Function Description
The operator integrates the Segment Anything Model, i.e., SAM model. SAM can segment any object in images based on user-provided real-time prompt points and prompt boxes without requiring additional training.
-
Prompt points: Provide one or multiple points on the target object to guide the model for segmentation.
-
Prompt boxes: Provide an approximate bounding box to let the model segment the main object within the box.
Input Output
Input |
Image: Single color image to perform segmentation. Prompt point list: A list containing N (X,Y) pixel coordinates, used to specify one or multiple points on objects to be segmented. Prompt box list: One or multiple 2D rectangular boxes, used to prompt the model to segment objects within the boxes. |
Output |
Detection result: Detection instance list. Each element in the list represents a segmented object, containing its user-specified class, model-given confidence score and contour polygon. |
Parameter Description
|
Weight File
Parameter Description |
Load officially released SAM model weight files (.pth format). The model size determines its accuracy, speed and resource consumption. Model download address (internal network): |
Parameter Adjustment |
Base model has the fastest speed and smallest resource occupation, suitable for scenarios with high real-time requirements; Large/Huge models have higher accuracy but slower speed and require more GPU memory. Please choose the appropriate model file according to actual application needs. |
Enable GPU
Parameter Description |
Controls whether the operator uses CPU or GPU for computation. |
Parameter Adjustment |
|
Confidence Threshold
Parameter Description |
SAM will give each generated segmentation result an IOU prediction score (confidence), filtering out segmentation results below this score through this threshold. |
Parameter Adjustment |
|
Parameter Range |
[0,1], default value: 0.5 |
Output Multiple Results
Parameter Description |
For a potentially ambiguous prompt, the model can generate multiple logically reasonable segmentation results. |
Parameter Adjustment |
|