ancebuc commited on
Commit
46314d9
1 Parent(s): b227b1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,9 +23,10 @@ def visualize_segmentation(image, prompts, preds):
23
 
24
  def segment(img, clases):
25
  print(img)
 
26
  prompts = clases.split(',')
27
 
28
- inputs = processor(text=prompts, images=[img] * len(img), padding="max_length", return_tensors="pt")
29
 
30
  outputs = model(**inputs)
31
  preds = outputs.logits.unsqueeze(1)
 
23
 
24
  def segment(img, clases):
25
  print(img)
26
+ image = PIL.Image.fromarray(img, 'RGB')
27
  prompts = clases.split(',')
28
 
29
+ inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
30
 
31
  outputs = model(**inputs)
32
  preds = outputs.logits.unsqueeze(1)