RetinaNet模型在DDSM数据集的应用问题(2)

今日的工作内容

  • 专注学习,早日对抗抑郁症!
  • 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 我不信明天起不来了~~
总的来说目前的状态整体 比之前的好一些

专注在学习上,对抗抑郁症!!!!
盐酸舍曲林就是个垃圾~

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DDSM(Digital Database for Screening Mammography)是一个用于乳腺癌筛查的数字化数据库,提供了大量的乳腺X射线摄影(mammography)图像和相关信息。如果想要下载DDSM数据集,可以按照以下步骤进行: 1. 访问DDSM官方网站:可以直接在搜索引擎中搜索“DDSM数据集官方网站”来找到相关链接。 2. 寻找数据集下载链接:一旦进入DDSM官方网站,可以浏览网站上的菜单栏或搜索框,寻找数据集下载链接。一般来说,这个链接应该在网站的主页或“数据集”(Dataset)部分。 3. 注册或登录:数据集可能需要用户进行注册或登录才能进行下载。根据网站要求,提供必要的个人信息进行注册,或使用已有账户登录。 4. 选择数据集类型和版本:根据需要,选择乳腺X射线摄影图像数据集。通常,DDSM提供了不同的数据集版本,可以根据需求选择最适合的版本。 5. 阅读和同意协议:下载数据集前,可能需要阅读和同意相关的协议和条款。这些协议通常包括对数据使用的限制和许可要求。 6. 下载数据集:一旦注册、登录并同意相关协议,就可以开始下载数据集。根据网站指示,选择合适的下载选项,等待下载完成。 需要注意的是,DDSM数据集是一个大型的数据库,包含了众多的图像和相关信息。因此,下载可能需要一定的时间和网络速度。同时,在使用数据集时需要遵守相关的数据使用和隐私保护法规,确保数据安全和合法使用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值