programmnix-askui commited on
Commit
c333dca
Β·
1 Parent(s): dc09f8c

test input

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -105,14 +105,15 @@ def deepseek(image, text_input, model_id):
105
  print(f"{prepare_inputs['sft_format'][0]}", answer)
106
  det_pattern = r"<\|det\|>\[\[(.+)]]<\|\/det\|>"
107
 
108
- det_content = re.search(det_pattern, answer).group(1)
109
- if det_content is None:
110
  return text_input, [], image
111
 
 
112
  bbox = [ int(v.strip()) for v in det_content.split(",")]
113
  #w, h = image.size
114
  #bbox = [[bbox[0] * w, bbox[1] * h, bbox[2] * w, bbox[3] * h]]
115
-
116
  scaled_boxes = rescale_bounding_boxes([bbox], image.width, image.height)
117
  return text_input, scaled_boxes, draw_bounding_boxes(image, scaled_boxes)
118
 
 
105
  print(f"{prepare_inputs['sft_format'][0]}", answer)
106
  det_pattern = r"<\|det\|>\[\[(.+)]]<\|\/det\|>"
107
 
108
+ det_match = re.search(det_pattern, answer)
109
+ if det_match is None:
110
  return text_input, [], image
111
 
112
+ det_content = det_match.group(1)
113
  bbox = [ int(v.strip()) for v in det_content.split(",")]
114
  #w, h = image.size
115
  #bbox = [[bbox[0] * w, bbox[1] * h, bbox[2] * w, bbox[3] * h]]
116
+
117
  scaled_boxes = rescale_bounding_boxes([bbox], image.width, image.height)
118
  return text_input, scaled_boxes, draw_bounding_boxes(image, scaled_boxes)
119