darknet_AlexeyAB_191221 - person - p*****_yolov3

darknet_AlexeyAB_191221 - person - p*****_yolov3

P*****_YOLOv3

1. anchors

2. p*****_yolov3.data

/home/yongqiang/darknet_work/darknet_AlexeyAB_191221/darknet-master/data/p*****_yolov3.data

classes= 1
train = /media/famu/DISK_DEEP/yongqiang/yolov3-tiny_prn/yolov3-tiny_prn.txt
# valid  = /media/famu/DISK_DEEP/yongqiang/yolov3-tiny_prn/training_validation_test_sets_person_v0.txt
valid  = /media/famu/DISK_DEEP/yongqiang/yolov3-tiny_prn/training_validation_test_sets_person_v0.txt
names = data/p*****_yolov3.names
backup = /media/famu/DISK_DATA/yongqiang/backup_p*****_yolov3
eval=coco

3. p*****_yolov3.names

/home/yongqiang/darknet_work/darknet_AlexeyAB_191221/darknet-master/data/p*****_yolov3.names

person

4. To calculate anchors

./darknet detector calc_anchors data/p*****_yolov3.data -num_of_clusters 8 -width 608 -height 608

(base) yongqiang@famu-sys:~/darknet_work/darknet_AlexeyAB_191221/darknet-master$ ./darknet detector calc_anchors data/p*****_yolov3.data -num_of_clusters 8 -width 608 -height 608

 num_of_clusters = 8, width = 608, height = 608 
 read labels from 130656 images 
 loaded 	 image: 130656 	 box: 1434742
 all loaded. 

 calculating k-means++ ...

 iterations = 129 


 avg IoU = 73.83 % 

Saving anchors to the file: anchors.txt 
anchors =  11, 42,  17, 75,  23,115,  33, 80,  35,155,  57,210, 119,347, 281,485
^C
(base) yongqiang@famu-sys:~/darknet_work/darknet_AlexeyAB_191221/darknet-master$ 

5. Training - ./darknet detector train ./train_cfg/p*****_yolov3.data ./train_cfg/p*****_yolov3.cfg -gpus 0,1,2,3 -map

Just train with -map flag:

darknet.exe detector train data/obj.data yolo-obj.cfg darknet53.conv.74 -map

So you will see mAP-chart (red-line) in the Loss-chart Window. mAP will be calculated for each 4 Epochs using valid=valid.txt file that is specified in obj.data file (1 Epoch = images_in_train_txt / batch iterations)
(to change the max x-axis value - change max_batches= parameter to 2000*classes, f.e. max_batches=6000 for 3 classes)

(base) yongqiang@famu-sys:~/darknet_work/darknet_AlexeyAB_191221/darknet-master$ ./darknet detector train ./train_cfg/p*****_yolov3.data ./train_cfg/p*****_yolov3.cfg -gpus 0,1,2,3 -map

6. mAP

[net]
# Testing
# batch=1
# subdivisions=1
# Training
batch=64
subdivisions=16
width=608
height=608
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1
......

First - 030
network resolution = 608 * 608
network resolution = 544 * 544
network resolution = 480 * 480
network resolution = 416 * 416
network resolution = 352 * 352

Second - 031
network resolution = 608 * 608
network resolution = 544 * 544
network resolution = 480 * 480
network resolution = 416 * 416
network resolution = 352 * 352

Total BFLOPS
network resolution = 608 * 608 Total BFLOPS
network resolution = 544 * 544 Total BFLOPS
network resolution = 480 * 480 Total BFLOPS
network resolution = 416 * 416 Total BFLOPS
network resolution = 352 * 352 Total BFLOPS

./darknet detector map ./cfg/p*****_yolov3.data ./cfg/p*****_yolov3.cfg /media/famu/DISK_DATA/yongqiang/p*****_yolov3_best.weights -i 1

6.1 network resolution = 608 * 608

6.2 network resolution = 544 * 544

6.3 network resolution = 480 * 480

6.4 network resolution = 416 * 416

6.5 network resolution = 352 * 352

你可能感兴趣的:(Darknet)