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)
| 10 | |
| 11 | class 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 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected