Martin Tomov commited on
Commit
d969435
·
verified ·
1 Parent(s): 1052aa8

@spaces.GPU typo fix

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -112,7 +112,7 @@ def detect(image: Image.Image, labels: List[str], threshold: float = 0.3, detect
112
  results = object_detector(image, candidate_labels=labels, threshold=threshold)
113
  return [DetectionResult.from_dict(result) for result in results]
114
 
115
- @spaces.GGPU
116
  def segment(image: Image.Image, detection_results: List[DetectionResult], polygon_refinement: bool = False, segmenter_id: Optional[str] = None) -> List[DetectionResult]:
117
  segmenter_id = segmenter_id if segmenter_id else "martintmv/InsectSAM"
118
  segmentator = AutoModelForMaskGeneration.from_pretrained(segmenter_id).to("cuda")
 
112
  results = object_detector(image, candidate_labels=labels, threshold=threshold)
113
  return [DetectionResult.from_dict(result) for result in results]
114
 
115
+ @spaces.GPU
116
  def segment(image: Image.Image, detection_results: List[DetectionResult], polygon_refinement: bool = False, segmenter_id: Optional[str] = None) -> List[DetectionResult]:
117
  segmenter_id = segmenter_id if segmenter_id else "martintmv/InsectSAM"
118
  segmentator = AutoModelForMaskGeneration.from_pretrained(segmenter_id).to("cuda")