承接SSD-Tensorflow 学习一:部署 ,接下来用自己的数据集对网络模型进行微调。
数据集的制作过程详见:数据集制作(pascal voc 格式)
准备工作做好之后接下来就是对SSD-Tensorflow进行微调。
1。 修改训练类类别
SSD-Tensorflow—>datasets—>pascalvoc_common.py 24行
VOC_LABELS = {
'none': (0, 'Background'),
'aeroplane': (1, 'Vehicle'),
'bicycle': (2, 'Vehicle'),
'bird': (3, 'Animal'),
'boat': (4, 'Vehicle'),
'bottle': (5, 'Indoor'),
'bus': (6, 'Vehicle'),
'car': (7, 'Vehicle'),
'cat': (8, 'Animal'),
'chair': (9, 'Indoor'),
'cow': (10, 'Animal'),
'diningtable': (11, 'Indoor'),
'dog': (12, 'Animal'),
'horse': (13, 'Animal'),
'motorbike': (14, 'Vehicle'),
'person': (15, 'Person'),
'pottedplant': (16, 'Indoor'),
'sheep': (17, 'Animal'),
'sofa': (18, 'Indoor'),
'train': (19, 'Vehicle'),
'tvmonitor': (20, 'Indoor'),
}
2。将图像数据转换为tfrecods格式
SSD-Tensorflow—>datasets—>pascalvoc_to_tfrecords.py 83行 更改读取方式为‘rb’
filename = directory + DIRECTORY_IMAGES + name + '.jpg'
image_data = tf.gfile.FastGFile(filename, 'b').read()
在 SSD-Tensorflow文件夹下创建tf_conver_data.sh
#!/bin/bash
#this is a shell script to convert pascal VOC datasets into tf-records only
#directory where the original dataset is stored
DATASET_DIR=/home/whut/yyCode/SSD-