Because Vitis AI only supports the deployment of TensorFlow, PyTorch, and Caffe models, it is necessary to convert a Darknet model to a deployable model format. An open source conversion tool that converts the Darknet model to a Caffe model is included in Caffe_xilinx. Convert the model, then follow the instructions in the Vitis AI User Guide (UG1414) to deploy the Caffe model to an FPGA.
Convert Darknet model to Caffe model
The easiest way to convert a Darknet model to Caffe model is running the convert.py script in the conda environment "vitis-ai-caffe" in the Vitis AI Docker container.
conda activate vitis-ai-caffe
The following is an example of converting a YOLOv3 model.
cd scripts
python convert.py ../pruning/model-transform.cfg ../pruning/weights.transform yolov3.prototxt yolov3.caffemodel
Refer to the Vitis AI User Guide for more information on the Docker container. You can also run the conversion without "vitis-ai-caffe" conda environment. In this case, first build the Caffe model, then build pyCaffe, and finally run convert.py.