Spaces:
Runtime error
Runtime error
Commit
Β·
86ce79d
1
Parent(s):
f1a4346
test input
Browse files
app.py
CHANGED
|
@@ -104,15 +104,14 @@ def deepseek(image, text_input):
|
|
| 104 |
|
| 105 |
answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=False)
|
| 106 |
|
| 107 |
-
|
| 108 |
det_pattern = r"<\|det\|>\[\[(.+)]]<\|\/det\|>"
|
| 109 |
|
| 110 |
det_content = re.search(det_pattern, answer).group(1)
|
| 111 |
bbox = [ int(v.trim()) / 999 for v in det_content.split(",")]
|
| 112 |
w, h = image.size()
|
| 113 |
bbox = [bbox[0] * w, bbox[1] * h, bbox[2] * w, bbox[3] * h]
|
| 114 |
-
|
| 115 |
-
print(f"{prepare_inputs['sft_format'][0]}", answer)
|
| 116 |
|
| 117 |
|
| 118 |
scaled_boxes = rescale_bounding_boxes(bbox, image.width, image.height)
|
|
|
|
| 104 |
|
| 105 |
answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=False)
|
| 106 |
|
| 107 |
+
print(f"{prepare_inputs['sft_format'][0]}", answer)
|
| 108 |
det_pattern = r"<\|det\|>\[\[(.+)]]<\|\/det\|>"
|
| 109 |
|
| 110 |
det_content = re.search(det_pattern, answer).group(1)
|
| 111 |
bbox = [ int(v.trim()) / 999 for v in det_content.split(",")]
|
| 112 |
w, h = image.size()
|
| 113 |
bbox = [bbox[0] * w, bbox[1] * h, bbox[2] * w, bbox[3] * h]
|
| 114 |
+
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
scaled_boxes = rescale_bounding_boxes(bbox, image.width, image.height)
|