Skip to content

DinoSam

Bases: ModelBase

__init__(sam_model_id='facebook/sam2.1-hiera-large', dino_model_id='IDEA-Research/grounding-dino-base', box_threshold=0.3, text_threshold=0.3, *args, **kwargs)

A model combining SAM2 and GroundingDINO for promptable instance segmentation. Inspired by LangSAM and SamGeo.

Parameters:

Name Type Description Default
sam_model_id str

SAM2 model. Possible options include 'facebook/sam2.1-hiera-tiny', 'facebook/sam2.1-hiera-small' and 'facebook/sam2.1-hiera-large'. Defaults to 'sam2.1-hiera-large'.

'facebook/sam2.1-hiera-large'
dino_model_id str

A GroundingDINO model. Defaults to "IDEA-Research/grounding-dino-base"

'IDEA-Research/grounding-dino-base'
box_threshold float

This parameter is used for modulating the identification of objects in the images. The box threshold is related to the model confidence, so a higher value makes the model more selective because it is equivalent to requiring the model to only select objects that it feels confident about. Defaults to 0.3.

0.3
text_threshold float

This parameter is also used for influencing the selectivity of the model by requiring a stronger association between the prompt and the segment. Defaults to 0.3.

0.3