From 70b43907145192010856645dce697c05cbdf056e Mon Sep 17 00:00:00 2001 From: Melt <60842553+NeKoooo233@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:49:58 +0800 Subject: [PATCH] Update export_onnx.py sorry, I made a mistake Fix previous pr error Lines 123-130 are abnormally indented Causes the loop to break out and only processes one image instead of a batch of images --- rtdetr_pytorch/tools/export_onnx.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rtdetr_pytorch/tools/export_onnx.py b/rtdetr_pytorch/tools/export_onnx.py index f4f1626b..789420f8 100644 --- a/rtdetr_pytorch/tools/export_onnx.py +++ b/rtdetr_pytorch/tools/export_onnx.py @@ -120,14 +120,14 @@ def forward(self, images, orig_target_sizes): # print(i, sum(scr > thrh)) - # for b, l in zip(box, lab): - # # Scale the bounding boxes back to the original image size - # b = [coord * original_size[j % 2] / 640 for j, coord in enumerate(b)] - # # Get the category name from the label - # category_name = mscoco_category2name[mscoco_label2category[l]] - # draw.rectangle(list(b), outline='red', width=2) - # font = ImageFont.truetype("Arial.ttf", 15) - # draw.text((b[0], b[1]), text=category_name, fill='yellow', font=font) + # for b, l in zip(box, lab): + # # Scale the bounding boxes back to the original image size + # b = [coord * original_size[j % 2] / 640 for j, coord in enumerate(b)] + # # Get the category name from the label + # category_name = mscoco_category2name[mscoco_label2category[l]] + # draw.rectangle(list(b), outline='red', width=2) + # font = ImageFont.truetype("Arial.ttf", 15) + # draw.text((b[0], b[1]), text=category_name, fill='yellow', font=font) # # Save the original image with bounding boxes # original_im.save('test.jpg')