今日的工作内容
- 专注学习,早日对抗抑郁症!
- github的使用
- 研究图片的底层,LJPEG是否可以送入RetinaNet读数据–可能不可以
github
1.我准备把每天的进展和代码(retinaNet 在服务器中的myCode提交上去)
2.不过真的很麻烦我不确定是否适用了。我的代码在服务器上
运行程序:
1.又是精确率低到爆炸的一天
0.0278???
are you kidding me???
这个简直是太搞笑了,如果数据没问题是不可能出现这样的错误的。
后来在运行的过程中看到了这样的警告。
-
keras-retinanet/keras_retinanet/preprocessing/generator.py:155: UserWarning: Image with id 687 (shape (3946, 2041, 3)) contains the following invalid boxes: [array([1397., 1861., 2056., 2612., 0.])].
-
这个图片在这里cancers_jpg/D_4185_1.RIGHT_CC.jpg,1397,1861,2056,2612,leisons
-
[annotations[invalid_index, :] for invalid_index in invalid_indices]
keras-retinanet/keras_retinanet/preprocessing/generator.py:155: UserWarning: Image with id 614 (shape (4696, 2131, 3)) contains the following invalid boxes: [array([2003., 2666., 2138., 2969., 0.])].
[annotations[invalid_index, :] for invalid_index in invalid_indices]
这里是图片的宽和高的问题。确实上面加粗的bounding box 2612>图片本身的大小2041
问题是 这里shape (3946, 2041, 3)) 应该是(2041,3946,3) 宽和高的顺序正好相反
这里我不清楚是什么样的原因。
代码在这里/home/ld/keras-retinanet/keras_retinanet/preprocessing/generator.py
def filter_annotations(self, image_group, annotations_group, group):
""" Filter annotations by removing those that are outside of the image bounds or whose width/height < 0.
"""
# test all annotations
for index, (image, annotations) in enumerate(zip(image_group, annotations_group)):
# test x2 < x1 | y2 < y1 | x1 < 0 | y1 < 0 | x2 <= 0 | y2 <= 0 | x2 >= image.shape[1] | y2 >= image.shape[0]
invalid_indices = np.where(
(annotations['bboxes'][:, 2] <= annotations['bboxes'][:, 0]) |
(annotations['bboxes'][:, 3] <= annotations['bboxes'][:, 1]) |
(annotations['bboxes'][:, 0] < 0) |
(annotations['bboxes'][:, 1] < 0) |
(annotations['bboxes'][:, 2] > image.shape[1]) |
(annotations['bboxes'][:, 3] > image.shape[0])
)[0]
# delete invalid indices
if len(invalid_indices):
warnings.warn('Image with id {} (shape {}) contains the following invalid boxes: {}.'.format(
group[index],
image.shape,
annotations['bboxes'][invalid_indices, :]
))
for k in annotations_group[index].keys():
annotations_group[index][k] = np.delete(annotations[k], invalid_indices, axis=0)
return image_group, annotations_group
2.RetinaNet网络的输入图片格式和大小问题
后来我无意中看到
image_min_side : After resizing the minimum side of an image is equal to image_min_side.
image_max_side : If after resizing the maximum side is larger than image_max_side, scales down further so that the max side is equal to image_max_side.
image_min_side=800,
image_max_side=1333,
- 发现问题:这个时候我就考虑是不是它自己默认给我剪裁了啊,我每张图片都非常大!
我觉得这可能是个问题所在,无论怎么样我都应该把数据集resize成一样的大小。为什么这么简单的问题我总是找了这么长时间才发现,专心的重要性?还是和老师讨论了之后的问题所在。
我也觉得奇怪啊。 - 解决问题:所以我明天要先尝试1张图片,就拿cancers_jpg/D_4185_1.RIGHT_CC.jpg,1397,1861,2056,2612,leisons 这个,resize成1000*1000大小,计算压缩后的长宽比例,然后bounding box的坐标就是也可以计算,这样重新保存csv文件,然后重新上传压缩后的图片,在尝试一下!!!!
- 发现问题2:虽然retianNet可以自己压缩图像,但我不确实压缩后的图像,还有bounding box的计算。这里有在/home/ld/keras-retinanet/keras_retinanet/bin/debug.py可以可视化的调试????
参数设置问题
python train.py --backbone=resnet50 --batch-size=8 --step=90 --epochs=10 --gpu 2 --image-min-side=224 --random–transform csv
1.–image-min-side=224 这里的最小的尺寸 需要重新商榷
2.batchsize*steps=样本的总数
linux 命令的
- 在文件中查找字符串grep -rn “D_4005” *
总结
晚上的时候有一点点负能量,脑袋里又是感情问题。跑步了1小时以后 觉得应该把注意力foucus在我的实验上,毕竟实验差了这么多我心里还没点数吗,浪了整个研一上,这周6的舞蹈课我也没去上。
今天早上的闹钟没把我叫醒,因为手机没电,我刚刚把ipad 设置了alarm 我不信明天起不来了~~
总的来说目前的状态整体 比之前的好一些
专注在学习上,对抗抑郁症!!!!
盐酸舍曲林就是个垃圾~