为一个对象配置YOLO-2张图片

时间:2018-07-24 15:05:27

标签: configuration computer-vision yolo

我正在为LISA TS数据集的https://github.com/wyfsh/YOLO-LISA的Yolo配置苦苦挣扎

因为它似乎什么也没学,而且我没有GPU,所以我想找出问题所在,只训练一堂课和两张图片,一张正面,一张负面。所以我的LISATS / train.txt看起来像:

LISATS / aiua120214-2 / frameAnnotations-DataLog02142012_002_external_camera.avi_annotations / speedLimit_1331867115.avi_image4.png LISATS / aiua120214-2 / frameAnnotations-DataLog02142012_002_external_camera.avi_annotations / dip_1331867215.avi_image12.png

第一张图片的注释文件如下:

0 0.77783203125 0.363026819923 0.0224609375 0.0555555555556

如果执行此操作,则会显示以下限速标志的图像:

coords = [float(x) for x in pd.read_csv(im_path + "txt",header=None)[0].values[0][2:].split(" ")]
box = [coords[0]*im.size[0],coords[1]*im.size[1],coords[2]*im.size[0],coords[3]*im.size[1]]
im_crop = im.crop((box[0] - box[2]/2, box[1]-box[3]/2, box[0]+box[2]/2, box[1]+box[3]/2))

enter image description here

第二张图像的注释文件为空。我的lisa.data看起来像:

classes = 1
train   = LISATS/train.txt
valid   = LISATS/valid.txt
names   = YOLO-LISA/data/lisa.names
backup  = backup/

在我的tiny-yolo-lisa.cfg中,我一开始就进行了更改:

[net]
# Testing
# batch=1
# subdivisions=1
# Training
batch=2
subdivisions=1
width=416
height=416

在卷积层中,我将滤镜更改为30,在区域层类中将滤镜更改为1。最后,我运行:

./darknet detector train cfg/lisa.data cfg/tiny-yolo-lisa.cfg darknet53.conv.74

但是损失不会减少,置信对象/无对象不变:

Region Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: 0.499697, Avg Recall: -nan,  count: 0
1: 458.704102, 458.704102 avg, 0.010000 rate, 16.950001 seconds, 2 images
.
.
.
91: 470.977173, 457.806976 avg, 0.010000 rate, 23.620001 seconds, 182 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.196962, Class: 1.000000, Obj: 0.499808, No Obj: 0.499694, Avg Recall: 0.000000,  count: 1
92: 454.916870, 457.517975 avg, 0.010000 rate, 23.709999 seconds, 184 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.151800, Class: 1.000000, Obj: 0.499825, No Obj: 0.499695, Avg Recall: 0.000000,  count: 1
93: 455.065369, 457.272705 avg, 0.010000 rate, 24.350000 seconds, 186 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.159382, Class: 1.000000, Obj: 0.499807, No Obj: 0.499696, Avg Recall: 0.000000,  count: 1
94: 455.820618, 457.127502 avg, 0.010000 rate, 24.209999 seconds, 188 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.174366, Class: 1.000000, Obj: 0.499823, No Obj: 0.499693, Avg Recall: 0.000000,  count: 1
95: 454.429993, 456.857758 avg, 0.010000 rate, 24.080000 seconds, 190 images
Loaded: 0.000000 seconds
Region Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: 0.499695, Avg Recall: -nan,  count: 0
96: 450.702148, 456.242188 avg, 0.010000 rate, 23.670000 seconds, 192 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.105682, Class: 1.000000, Obj: 0.499825, No Obj: 0.499696, Avg Recall: 0.000000,  count: 2
97: 462.931458, 456.911102 avg, 0.010000 rate, 24.450001 seconds, 194 images
Loaded: 0.000000 seconds
Region Avg IOU: 0.060254, Class: 1.000000, Obj: 0.499750, No Obj: 0.499696, Avg Recall: 0.000000,  count: 1
98: 461.561005, 457.376099 avg, 0.010000 rate, 24.490000 seconds, 196 images
Loaded: 0.000000 seconds
Region Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: 0.499695, Avg Recall: -nan,  count: 0
99: 450.700653, 456.708557 avg, 0.010000 rate, 24.360001 seconds, 198 images
Loaded: 0.000000 seconds
Region Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: 0.499695, Avg Recall: -nan,  count: 0
100: 450.699158, 456.107605 avg, 0.010000 rate, 23.250000 seconds, 200 images

我尝试了0.1,0.01,0.001的学习率,但似乎从没学过任何东西。我在做什么错了?

如果整个训练集中只有一个对象,那么计数如何为2?

0 个答案:

没有答案