yolov3/README.md
The Pytorch implementation is ultralytics/yolov3 archive branch. It provides two trained weights of yolov3, yolov3.weights and yolov3.pt
This branch is using tensorrt7 API, there is also a yolov3 implementation using tensorrt4 API, go to branch trt4/yolov3, which is using ayooshkathuria/pytorch-yolo-v3.
git clone https://github.com/wang-xinyu/tensorrtx.git
git clone -b archive https://github.com/ultralytics/yolov3.git
// download its weights 'yolov3.pt' or 'yolov3.weights'
cp {tensorrtx}/yolov3/gen_wts.py {ultralytics/yolov3/}
cd {ultralytics/yolov3/}
python gen_wts.py yolov3.weights
// a file 'yolov3.wts' will be generated.
// the master branch of yolov3 should work, if not, you can checkout cf7a4d31d37788023a9186a1a143a2dab0275ead
mv yolov3.wts {tensorrtx}/yolov3/
cd {tensorrtx}/yolov3
mkdir build
cd build
cmake ..
make
sudo ./yolov3 -s // serialize model to plan file i.e. 'yolov3.engine'
sudo ./yolov3 -d ../../yolov3-spp/samples // deserialize plan file and run inference, the images in samples will be processed.
Prepare calibration images, you can randomly select 1000s images from your train set. For coco, you can also download my calibration images coco_calib from GoogleDrive or BaiduPan pwd: a9wh
unzip it in yolov3/build
set the macro USE_INT8 in yolov3.cpp and make
serialize the model and test
See the readme in home page.