SSD Installation Training data set
Transfer from http://lib.csdn.net/article/deeplearning/53859
In the home directory, get the SSD code, after the download is complete there is a Caffe folder
git clone https://github.com/weiliu89/caffe.git
cd caffe
git Checkout SSD
1 2 3 Go to the downloaded Caffe directory, copy the configuration file
Cd/home/usrname/caffe
CP Makefile.config.example Makefile.config
1 2 1 2 compiling Caffe Trilogy
Make-j8 //-j8 According to the processor configuration of the machine, 8 is the meaning of the eight-core processor make
test-j8 make
runtest-j8
1 2 3 1 2 3 additional compilation, as needed (because SSD is done with Python, compile Pycaffe)
Make PY
preparatory work
Download the pre-training model link: http://pan.baidu.com/s/1miDE9h2 password: 0hf2, put it in the caffe/models/vggnet/directory
Download the VOC2007 and VOC2012 datasets and put them under/home/data. (Please note that the directory is changed here.)
CD..
mkdir Data
CD data/
1 2 3 1 2 3 download DataSet
wget Http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget/http Host.robots.ox.ac.uk/pascal/voc/voc2007/voctrainval_06-nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal /voc/voc2007/voctest_06-nov-2007.tar
1 2 3 1 2 3 Data set decompression
TAR-XVF Voctrainval_11-may-2012.tar
tar-xvf voctrainval_06-nov-2007.tar
tar-xvf VOCtest_06-Nov-2007.tar
1 2 3 1 2 3 Convert a picture to a Lmdb file for training
CD..
CD caffe/
./data/voc0712/create_list.sh
./data/voc0712/create_data.sh
1 2 3 4 1 2 3 4 Here The Script implementation batch, may appear: No module named Caffe and other errors, this is because the Caffe Python environment variable is not configured, can be resolved as follows:
echo "Export Pythonpath=/home/usrname/caffe/python" >> ~/.profile
source ~/.profile
Echo $PYTHONPATH # Check the values of environment variables
Training ModelIn the download Caffe root directory to perform the following command training, there are several. py files under EXAMPLES/SSD, the training time is longer, iteration 60,000 times, Bo Master training for one day.
Python examples/ssd/ssd_pascal.py
1 1
Experimental Results
(1) test on the picture test set
Python examples/ssd/score_ssd_pascal.py
1 1
Using it to run over the data set, the accuracy rate can be up to 70 (2) tested on video
1 1
The use of senior pedestrian video to do the test, real-time high, but the missing rate is quite serious, it is inevitable
Of course, the direct run is his own video, want to run their own code, to first use VIM to open the file, positioning to 51 lines, modify the video path for the local video, so you can run their own video (3) on the camera head test
Python examples/ssd/ssd_pascal_webcam.py
1 1
Bo Master transplanted to the desktop problems, has not changed the bug, changed to share to everyone later work Research SSD python source code, used to train and detect traffic signs The author given a pre-training model
If there is no good machine configuration or easier, you can use the trained model given by the author: Models trained on voc0712:ssd300 SSD500
There are other models, not listed here, interested can go to the official homepage to see, the link has been given in front
Recently has been engaged in the object detection play, before using the FASTER-RCNN, the accuracy of 73.2%, the effect is good, but the recognition speed is a bit short, I use the GPU is gtx980ti, recognition speed is about 15fps. Recently discovered SSD ( Single shot Multibox detector) This paper has a good effect and speed, I have experimented with it, the speed is indeed much faster than FASTER-RCNN. The following is a two-part introduction. The first section describes the installation of SSDs, and the second section describes how to train your own data sets based on SSDs.
1 2 3 1 2 3
the second part trains your own data sets
First of all, we might as well run a demo of the project, need to download datasets, pre-trained data sets, and so on.
Download the pre-trained model, Link: http://pan.baidu.com/s/1miDE9h2 password: 0hf2, after the download is complete to protect the existence:
caffe/models/vggnet/
1 1
Download the VOC2007 and VOC2012 datasets, placed in the/data directory:
CD data
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget/http Host.robots.ox.ac.uk/pascal/voc/voc2007/voctrainval_06-nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal /voc/voc2007/voctest_06-nov-2007.tar
tar-xvf voctrainval_11-may-2012.tar
tar-xvf VOCtrainval_06- Nov-2007.tar
TAR-XVF Voctest_06-nov-2007.tar
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
To create data in Lmdb format:
CD Caffe
./data/voc0712/create_list.sh
# It'll create Lmdb files for Trainval and test with encoded original IMA GE:
# -$HOME/data/vocdevkit/voc0712/lmdb/voc0712_trainval_lmdb
# -$HOME/data/vocdevkit/voc0712 /lmdb/voc0712_test_lmdb
./data/voc0712/create_data.sh
1 2 3 4 5 6 1 2 3 4 5 6
Training and testing:
Python examples/ssd/ssd_pascal.py