dwb2023 commited on
Commit
fab2a03
·
verified ·
1 Parent(s): 1613b9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -16,7 +16,7 @@ COLORS = ['#4285f4', '#db4437', '#f4b400', '#0f9d58', '#e48ef1']
16
  ##### Also returns bounding boxes with their labels
17
 
18
  def parse_segmentation(input_image, input_text, max_new_tokens=100):
19
- out = pali_gemma_model.infer(input_image, input_text, max_new_tokens=max_new_tokens)
20
  objs = extract_objs(out.lstrip("\n"), input_image.size[0], input_image.size[1], unique_labels=True)
21
  labels = set(obj.get('name') for obj in objs if obj.get('name'))
22
  color_map = {l: COLORS[i % len(COLORS)] for i, l in enumerate(labels)}
 
16
  ##### Also returns bounding boxes with their labels
17
 
18
  def parse_segmentation(input_image, input_text, max_new_tokens=100):
19
+ out = pali_gemma_model.infer(image=input_image, text=input_text, max_new_tokens=max_new_tokens)
20
  objs = extract_objs(out.lstrip("\n"), input_image.size[0], input_image.size[1], unique_labels=True)
21
  labels = set(obj.get('name') for obj in objs if obj.get('name'))
22
  color_map = {l: COLORS[i % len(COLORS)] for i, l in enumerate(labels)}