Add CLI support for SAM, RTDETR (#3253)

This commit is contained in:
Glenn Jocher
2023-06-18 22:47:33 +02:00
committed by GitHub
parent 4c2033d7c3
commit 58bccb1a9f
2 changed files with 10 additions and 2 deletions

View File

@ -17,6 +17,7 @@ class SAM:
# Should raise AssertionError instead?
raise NotImplementedError('Segment anything prediction requires pre-trained checkpoint')
self.model = build_sam(model)
self.task = 'segment' # required
self.predictor = None # reuse predictor
def predict(self, source, stream=False, **kwargs):