linghu8812 / tensorrt_inference

705 stars 207 forks source link

Can you tell me how to calculate a ratio for postProcess? #64

Open leeyunhome opened 3 years ago

leeyunhome commented 3 years ago

Hello, @linghu8812

Thank you for sharing a great project.

on line 210 in yolov5.cpp float ratio = float(src_img.cols) / float(IMAGE_WIDTH) > float(src_img.rows) / float(IMAGE_HEIGHT) ? float(src_img.cols) / float(IMAGE_WIDTH) : float(src_img.rows) / float(IMAGE_HEIGHT);

Why divide src_img.cols by IMAGE_WIDTH?

Thank you.

linghu8812 commented 3 years ago

@leeyunhome It is necessary to restore the detected boxes calculated by resize image to the original image