zherlock030 / YOLOv5_Torchscript

C++ code for running a yolov5s model.
27 stars 6 forks source link

One suggestion #7

Closed FantasyJXF closed 4 years ago

FantasyJXF commented 4 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 4 years ago

@FantasyJXF Thanks for your advice.