Thanks for the great work of neverleave0916 who created the docker image of yolov4!
Without the need of a local superpower graphics card. You can use Vast.ai to try yolov4 rapidly. Vasi.ai is a online platform that provides GPU rental services at a good value.
Rent a GPU
To start, firstly please register a Vast.ai account, add a payment and your public SSH key. Then, click the Create button located in the left sidebar. You can see a number of available machines in the page. Before you rent any instances, please click the blue button Edit Image & Config as we need to use a custom docker image neverleave0916/yolo_v4. Then, we can start to rent a instance by clicking the rent button, such as a GTX 1080 machine.
Then, go to instances page directly, and the SSH connection information is there. Once the instance is ready to connect, the CONNECT button will be shown and lighted up. Use any SSH client you prefer to connect.
Start Yolov4
1. Clone the yolov4 repo.
1 |
git clone --depth=1 https://github.com/AlexeyAB/darknet |
2. Edit the makefile.
1 2 |
cd darknet vi Makefile |
3. Make sure the following options is enabled in the makefile.
1 2 3 4 5 6 7 8 9 |
GPU=1 CUDNN=1 CUDNN_HALF=1 OPENCV=1 AVX=0 OPENMP=1 LIBSO=1 ZED_CAMERA=0 # ZED SDK 3.0 and above ZED_CAMERA_v2_8=0 # ZED SDK 2.X |
4. Compile yolov4
1 |
make |
5. Download pre-trained weights
1 |
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights |
6. Test yolov4
1 |
./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/person.jpg -i 0 -thresh 0.25 -dont_show |
7. Once finished, you can find predictions.jpg in the folder.