2018年5月17日星期四

Keras-retinanet训练自己数据集

VOC文件夹ImageSets/Main中txt文件只有图片名称,没有路径没有后缀。

keras-retinanet/keras_retinanet/preprocessing/pascal_voc.py中修改:

#voc_classes = {
#    'aeroplane'   : 0,
#    'bicycle'     : 1,
#    'bird'        : 2,
#    'boat'        : 3,
#    'bottle'      : 4,
#    'bus'         : 5,
#    'car'         : 6,
#    'cat'         : 7,
#    'chair'       : 8,
#    'cow'         : 9,
#    'diningtable' : 10,
#    'dog'         : 11,
#    'horse'       : 12,
#    'motorbike'   : 13,
#    'person'      : 14,
#    'pottedplant' : 15,
#    'sheep'       : 16,
#    'sofa'        : 17,
#    'train'       : 18,
#    'tvmonitor'   : 19
#}


voc_classes = {
        'crazing'          :0,
        'inclusion'        :1,
        'patches'          :2,
        'pitted_surface'   :3,
        'rolled-in_scale'  :4,
        'scratches'        :5
        }

运行命令
keras_retinanet/bin/train.py pascal (绝对路径)/VOCdevkit/VOC2007
最好采用csv格式训练
 python3 keras_retinanet/bin/train.py csv ./CSV/annotations.csv ./CSV/classes.csv

没有评论:

发表评论

Failed to find TIFF library

ImportError: Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|.. 解决方法: ...