nielsr HF staff commited on
Commit
8483f38
1 Parent(s): 8edd24a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -8,9 +8,8 @@ import cv2
8
  processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
9
  model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
10
 
11
- def process_image(image, prompts):
12
- prompts = list(prompts)
13
- inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")
14
 
15
  # predict
16
  with torch.no_grad():
 
8
  processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
9
  model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")
10
 
11
+ def process_image(image, prompt):
12
+ inputs = processor(text=prompt, images=image, padding="max_length", return_tensors="pt")
 
13
 
14
  # predict
15
  with torch.no_grad():