Skip to content

Commit 699e00a

Browse files
committed
Update utils.py
1 parent 3c2cd21 commit 699e00a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

deepseek_vl2/serve/app_modules/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def pil_to_base64(
270270
def parse_ref_bbox(response, image: Image.Image):
271271
try:
272272
image = image.copy()
273-
image_h, image_w = image.size
273+
image_w, image_h = image.size
274274
draw = ImageDraw.Draw(image)
275275

276276
ref = re.findall(r'<\|ref\|>.*?<\|/ref\|>', response)
@@ -291,10 +291,10 @@ def parse_ref_bbox(response, image: Image.Image):
291291

292292
for indice, (box, label) in enumerate(zip(boxes, labels)):
293293
box = (
294-
int(box[0] / 999 * image_h),
295-
int(box[1] / 999 * image_w),
296-
int(box[2] / 999 * image_h),
297-
int(box[3] / 999 * image_w),
294+
int(box[0] / 999 * image_w),
295+
int(box[1] / 999 * image_h),
296+
int(box[2] / 999 * image_w),
297+
int(box[3] / 999 * image_h),
298298
)
299299

300300
box_color = BOX2COLOR[indice % len(BOX2COLOR.keys())]

0 commit comments

Comments
 (0)