tensorrtx
tensorrtx copied to clipboard
Add the possibility to crop the image
There are 2 main advantages : doesn't add a big padding for images of 16:9 aspect ratio that should be converted to 640*640 + It is faster ! the resizing and padding takes 20 to 30 ms on a jetson nano (the model execution 'YOLOv5n6' takes only 33ms).
@Mustapha-AJEGHRIR Thanks,
I have doubts here, what's the input shape of the tensorrt model in your case?
For my case, it is a "YOLOv5n6" so the input shape is 640*640
I have also changed the xywh2xyxy
function to correctly draw the bounding boxes. But I will have to admit that this approach will not be beneficial for most people especially since it does not detect objects near the cropped borders. For my application, this is fine.
@Mustapha-AJEGHRIR So the model input is 640x640, and your original image is 1920x1080? You crop a 640x640 region from 1920x1080 directly? Is it?
For my case, the original resolution is 1280*720. Then I directly crop the image (I lose the borders)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.