Segment Anything (Fast)

Description

This operator performs fast instance segmentation on input images based on user-provided prompts such as boxes, points, or text descriptions, and extracts object regions corresponding to the prompts.

Overview

Quickly generates image segmentation instances from point, box, or optional text prompts.

Scenarios

  • Interactive Segmentation: When specific objects of interest in an image need to be quickly segmented, prompt boxes, prompt points, or text descriptions can be input to guide the model.

  • Target Extraction: Used to precisely extract contour information of specific targets from complex backgrounds.

  • Automated Annotation Assistance: Can serve as part of an automated annotation workflow to quickly generate preliminary segmentation masks for targets via simple prompts.

Inputs and Outputs

Inputs

Image: The color image to be segmented (requires RGB format).

Prompt Point List (Optional): A list containing multiple point coordinates [X, Y] used to indicate the target regions to be segmented. For example, clicking several points on the target.

Prompt Box List (Optional): A list containing multiple bounding box coordinates, where each box is defined by four corner points, used to select the target regions to be segmented.

Outputs

Detection Results: A list containing segmentation results. Each result represents a segmented instance, containing its bounding box (which may be a rotated box or a horizontal box), category (default is 0 or a specified category), confidence score, and segmented polygon contour.

Parameters

Initialization Parameters

Weight File

Description

Selects a FastSAM segmentation model file.

Tuning Instructions

Only the listed model formats are accepted; the model must match the selected inference device.

Download Links

Parameter Range

Options: .pt, .epicnn

Parameter Range

Values/Range:

  • .pt

  • .epicnn

Inference Platform

Description

Selects the compute device used for FastSAM inference.

Tuning Instructions

CPU uses the processor; CUDA GPU requires an available CUDA environment.

Parameter Range

Options: CPU, CUDA GPU, Default: CPU

Parameter Range

Values/Range:

  • CPU

  • CUDA GPU

Default: CPU

Image Size

Description

Sets the image size used for inference resizing.

Tuning Instructions

This value is set when the detector is initialized and reused for subsequent runs.

Parameter Range

[160, 5000], Default: 640

Parameter Range

Values/Range: [160, 5000]

Default: 640

Run Parameters

Confidence Threshold

Description

Sets the confidence threshold for candidate segmentation results.

Tuning Instructions

This value is updated with the IoU and text thresholds on every run.

Parameter Range

[0.0, 1.0], Default: 0.8

Parameter Range

Values/Range: [0.0, 1.0]

Default: 0.8

Overlap Filtering Threshold

Description

Sets the IoU threshold used to filter overlapping results.

Tuning Instructions

This value is passed to the detector overlap-filtering configuration on every run.

Parameter Range

[0.0, 1.0], Default: 0.9

Parameter Range

Values/Range: [0.0, 1.0]

Default: 0.9

Category Name

Description

Assigns a class number to output segmentation instances.

Tuning Instructions

The selected number is assigned to every generated valid result.

Parameter Range

Options: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, Default: 0

Parameter Range

Values/Range:

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

  • 11

  • 12

  • 13

  • 14

  • 15

  • 16

  • 17

  • 18

  • 19

  • 20

  • 21

  • 22

  • 23

  • 24

  • 25

  • 26

  • 27

  • 28

  • 29

Default: 0

Text Prompt

Description

Provides text used to locate the target to segment.

Tuning Instructions

Used only when Use Text Prompt is enabled; quotes are removed and text is converted to lowercase.

Parameter Range

Default:

Text Prompt Threshold

Description

Sets the filtering threshold for text-prompt matches.

Tuning Instructions

This value is used only for text-prompt match filtering and is updated on every run.

Parameter Range

[0.0, 10], Default: 0.01

Parameter Range

Values/Range: [0.0, 10]

Default: 0.01

Use Text Prompt

Description

Controls whether a text prompt is used for segmentation.

Tuning Instructions

When enabled, Text Prompt is read; when disabled, no text prompt is passed to the detector.

Parameter Range

Default: False