ancebuc commited on
Commit
dc599f7
1 Parent(s): 2561975

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -33,8 +33,10 @@ def segment(img, clases):
33
  prompts = clases.split(',')
34
 
35
  inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
 
36
 
37
- outputs = model(**inputs)
 
38
  preds = outputs.logits.unsqueeze(1)
39
 
40
  return visualize_segmentation(image, prompts, preds)
 
33
  prompts = clases.split(',')
34
 
35
  inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
36
+
37
 
38
+ with torch.no_grad():
39
+ outputs = model(**inputs)
40
  preds = outputs.logits.unsqueeze(1)
41
 
42
  return visualize_segmentation(image, prompts, preds)