Darknet is a framework designed based on C language for object detection training
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install git wget build-essential python3-dev python3-pip
$ sudo apt install libopencv-dev
$ sudo pip3 install opencv-python
The latest version has been updated to 4.1.x.You can specify the version number to install 3.4.x.
Refer thisCUDA and cudnn installation
$ mkdir ~/git
$ cd ~/git
$ git clone https://github.com/pjreddie/darknet.git
$ cd darknet
You need to configure Darknet to fit your PC before completed it.Edit
$ vim Makefile
Enable GPU and enable cudnn
If you use CPU to train, you should keep it default.
Opencv is required for most object detection in
make with shell,
wait it to build compiled.
./darknet imtest data/eagle.jpg
If you look some pictures like this.It mean you install success.
$ wget https://pjreddie.com/media/files/yolov3.weights
$ ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
You would look a picture:
You can use webcam with this comand.
$ ./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights
You can see the effect of real-time monitoring.
- opencv install fail,unistall the
opencvwhich was install in you PC.And then you can reinstall it fllow this page.
- opencv version is invalid,you should check you opencv version >=3.0
cudnn install fail，reinstall it with this pageInstall cuda and cudnn
It is possible that there is not enough memory in GPU, and Darknet requires high GPU.