MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / __init__

Method __init__

tasks/interactive_predictor.py:12–24  ·  view source on GitHub ↗

thresh: iou thresh to filter low confidence objects text_size: resize the input image short edge for the model to process hole_scale: fill in small holes as in SAM island_scale: remove small regions as in SAM

(self, model, thresh=0.5, text_size=640, hole_scale=100, island_scale=100)

Source from the content-addressed store, hash-verified

10
11class SemanticSAMPredictor:
12 def __init__(self, model, thresh=0.5, text_size=640, hole_scale=100, island_scale=100):
13 """
14 thresh: iou thresh to filter low confidence objects
15 text_size: resize the input image short edge for the model to process
16 hole_scale: fill in small holes as in SAM
17 island_scale: remove small regions as in SAM
18 """
19 self.model = model
20 self.thresh = thresh
21 self.text_size = hole_scale
22 self.hole_scale = hole_scale
23 self.island_scale = island_scale
24 self.point = None
25
26 def predict(self, image_ori, image, point=None):
27 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected