1 Star 0 Fork 0

sdboy/tensorrtx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

scaled-yolov4

The Pytorch implementation is from WongKinYiu/ScaledYOLOv4 yolov4-csp branch. It can load yolov4-csp.cfg and yolov4-csp.weights(from AlexeyAB/darknet).

Note: There is a slight difference in yolov4-csp.cfg for darknet and pytorch. Use the one given in the above repo.

Config

  • Input shape INPUT_H, INPUT_W defined in yololayer.h
  • Number of classes CLASS_NUM defined in yololayer.h
  • FP16/FP32 can be selected by the macro USE_FP16 in yolov4_csp.cpp
  • GPU id can be selected by the macro DEVICE in yolov4_csp.cpp
  • NMS thresh NMS_THRESH in yolov4_csp.cpp
  • bbox confidence threshold BBOX_CONF_THRESH in yolov4_csp.cpp
  • BATCH_SIZE in yolov4_csp.cpp

How to run

  1. generate yolov4_csp.wts from pytorch implementation with yolov4-csp.cfg and yolov4-csp.weights.
git clone https://github.com/wang-xinyu/tensorrtx.git
git clone -b yolov4-csp https://github.com/WongKinYiu/ScaledYOLOv4.git
// download yolov4-csp.weights from https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-csp#yolov4-csp
cp {tensorrtx}/scaled-yolov4/gen_wts.py {ScaledYOLOv4/}
cd {ScaledYOLOv4/}
python gen_wts.py yolov4-csp.weights
// a file 'yolov4_csp.wts' will be generated.
  1. put yolov4_csp.wts into {tensorrtx}/scaled-yolov4, build and run
mv yolov4_csp.wts {tensorrtx}/scaled-yolov4/
cd {tensorrtx}/scaled-yolov4
mkdir build
cd build
cmake ..
make
sudo ./yolov4csp -s                          // serialize model to plan file i.e. 'yolov4csp.engine'
sudo ./yolov4csp -d ../../yolov3-spp/samples // deserialize plan file and run inference, the images in samples will be processed.
  1. check the images generated, as follows. _zidane.jpg and _bus.jpg

More Information

See the readme in home page.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/sdboy/tensorrtx.git
git@gitee.com:sdboy/tensorrtx.git
sdboy
tensorrtx
tensorrtx
master

搜索帮助