zherlock030 / YOLOv5_Torchscript

C++ code for running a yolov5s model.
28 stars 5 forks source link

One suggestion #7

Closed FantasyJXF closed 3 years ago

FantasyJXF commented 3 years ago

Thanks for your sharing, the repo helps me a lot.

There are many place for you to improve your code, such as this line, it would be better to write it this way in C++, since the int and float/double convert might lose precision, which would make the inference wrong.

    int top = dh / 2;
    int bottom = dh - top;
    int left = dw / 2;
    int right = dw - left;
zherlock030 commented 3 years ago

@FantasyJXF Thanks for your advice.