Martin Tomov commited on
Commit
ea41ff1
1 Parent(s): ca021c4
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -109,7 +109,7 @@ def detect(image: Image.Image, labels: List[str], threshold: float = 0.3, detect
109
  results = object_detector(image, candidate_labels=labels, threshold=threshold)
110
  return [DetectionResult.from_dict(result) for result in results]
111
 
112
- @spaces.GGPU
113
  def segment(image: Image.Image, detection_results: List[DetectionResult], polygon_refinement: bool = False, segmenter_id: Optional[str] = None) -> List[DetectionResult]:
114
  segmenter_id = segmenter_id if segmenter_id else "martintmv/InsectSAM"
115
  segmentator = AutoModelForMaskGeneration.from_pretrained(segmenter_id).to("cuda")
 
109
  results = object_detector(image, candidate_labels=labels, threshold=threshold)
110
  return [DetectionResult.from_dict(result) for result in results]
111
 
112
+ @spaces.GPU
113
  def segment(image: Image.Image, detection_results: List[DetectionResult], polygon_refinement: bool = False, segmenter_id: Optional[str] = None) -> List[DetectionResult]:
114
  segmenter_id = segmenter_id if segmenter_id else "martintmv/InsectSAM"
115
  segmentator = AutoModelForMaskGeneration.from_pretrained(segmenter_id).to("cuda")