yasenh / libtorch-yolov5

A LibTorch inference implementation of the yolov5
MIT License
372 stars 114 forks source link

there is no clip coords process in your code #16

Closed lishiyu93 closed 3 years ago

lishiyu93 commented 3 years ago

Hi, when i use your code , i find a problem. In python version code of yolov5, there is a clip_coords function in /utils/general.py(240 rows) which is to Clip bounding xyxy bounding boxes to image shape (height, width). Sometimes my predict box value may out of image size, so i add a clip coords process in your detector.cpp code. I wonder if I'm doing the right thing. Thank you for sharing.

yasenh commented 3 years ago

@lishiyu93 thanks for the feedback, will add it

yasenh commented 3 years ago

@lishiyu93 Added 0fa81cfa46499a25ee8622beabbdf3dc4b887526