Skip to main content

SAMDetector (segmented)

ImpactPack/Detector
SAMDetectorSegmented

Example

JSON Example
{
  "class_type": "SAMDetectorSegmented",
  "inputs": {
    "sam_model": [
      "node_id",
      0
    ],
    "segs": [
      "node_id",
      0
    ],
    "image": [
      "node_id",
      0
    ],
    "detection_hint": "center-1",
    "dilation": 0,
    "threshold": 0.93,
    "bbox_expansion": 0,
    "mask_hint_threshold": 0.7,
    "mask_hint_use_negative": "False"
  }
}

This example shows required inputs only. Connection values like ["node_id", 0] should reference actual node IDs from your workflow.

Inputs

NameTypeStatusConstraintsDefault
sam_model?SAM_MODELrequired--
segs?SEGSrequired--
image?IMAGErequired--
detection_hint?ENUM
9 options
  • center-1
  • horizontal-2
  • vertical-2
  • rect-4
  • diamond-4
  • mask-area
  • mask-points
  • mask-point-bbox
  • none
required--
dilation?INTrequiredmin: -512, max: 512, step: 10
thresholdFLOATrequiredmin: 0, max: 1, step: 0.010.93
bbox_expansion?INTrequiredmin: 0, max: 1000, step: 10
mask_hint_threshold?FLOATrequiredmin: 0, max: 1, step: 0.010.7
mask_hint_use_negative?ENUM
3 options
  • False
  • Small
  • Outter
required--

Outputs

IndexNameTypeIs ListConnection Reference
0combined_maskMASKNo["{node_id}", 0]
1batch_masksMASKNo["{node_id}", 1]
How to connect to these outputs

To connect another node's input to an output from this node, use the connection reference format:

["node_id", output_index]

Where node_id is the ID of this SAMDetectorSegmented node in your workflow, and output_index is the index from the table above.

Example

If this node has ID "5" in your workflow:

  • combined_mask (MASK): ["5", 0]
  • batch_masks (MASK): ["5", 1]
Was this page helpful?