Faster

See the above code is on github search is implemented with pytorch site at faster-rcnn-pytorch

The main process is as follows

  • First content to a local git

  • Prepare a data set, where I first used a data set is voc2007

Download follows

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
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar

tar xvf VOCtrainval_06-Nov-2007.tar
tar xvf VOCtest_06-Nov-2007.tar
tar xvf VOCdevkit_08-Jun-2007.tar
~                                            

The objective of the work referred to $FASTERRCNN, create a directory in this data, and the downloaded data in the decompression good on the inside or create a soft link can be to rename VOCdevkit2007,

  • Download pretrained model, I am here to use vgg16, on data/pretrained_model/vgg16_caffe.pth.

  • Cloth training environment, because there are nms used, roi-pooling, and so these need to compile cuda, where the choice is pytorch0.4, cuda9.0 currently pytorch1.0 has not been successful trial, seems more cuda90 No (the main reason is the code inside the code cuda if some of the old update, it should still be used.)

  • Some package python

Run directly pip install -r requirements.txt

  • Compile the code cuda

Run into the lib directory ./make.shif no error, then it can be trained

  • Training run




#CUDA_VISIBLE_DEVICES=$GPU_ID 
BATCH_SIZE=1
WORKER_NUMBER=2
DECAY_STEP=100
LEARNING_RATE=0.001
python trainval_net.py 
                   --dataset pascal_voc --net vgg16 
                   --bs $BATCH_SIZE --nw $WORKER_NUMBER 
                   --lr $LEARNING_RATE --lr_decay_step $DECAY_STEP 
  大专栏  Faster                  --cuda

I use my gtx1060 6Gtraining night (cry ...) ran 10 epoch, to kill off

  • test
SESSION=1
EPOCH=9
CHECKPOINT=10021
python test_net.py --dataset pascal_voc --net vgg16 
                   --checksession $SESSION --checkepoch $EPOCH --checkpoint $CHECKPOINT 
                   --cuda 
                   --vis


Note --visthat visualization will save some of the results, attention should correspond to the cv2...place of uncommented.

The end result is

AP for aeroplane = 0.6424
AP for bicycle = 0.7631
AP for bird = 0.6314
AP for boat = 0.4765
AP for bottle = 0.5283
AP for bus = 0.7190
AP for car = 0.8080
AP for cat = 0.7815
AP for chair = 0.4219
AP for cow = 0.7183
AP for diningtable = 0.5745
AP for dog = 0.6820
AP for horse = 0.7702
AP for motorbike = 0.7275
AP for person = 0.7586
AP for pottedplant = 0.4121
AP for sheep = 0.6177
AP for sofa = 0.5467
AP for train = 0.6708
AP for tvmonitor = 0.6562
Mean AP = 0.6453


The results show map

avator avator avator avator

Then also view a RCNN used rois what.

avator

Above 256 rois painted.

I used to do voc2007 of and would like to know in the end how the data set is marked after the training is completed, such as the inside of what the situation is difficult, these have not done any special treatment in the training, or other normal Like go directly to the train. There are several figures look 'difficult situation.

avator avator avator

In fact, these are actually some of which is not clear or incomplete.

Guess you like

Origin www.cnblogs.com/sanxiandoupi/p/11711240.html