PSMNet:Pyramid Stereo Matching Network学习测试笔记03-如何训练网络

本文深入探讨PSMNet立体匹配网络的工作原理及源码实现细节,讲解了网络在训练与测试阶段的不同预处理流程,包括图像裁剪与空白扩充等数据增强手段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

写在前面的话:
2019年09月28日18:02:55补充说明:优快云博客发布版权更新,如果您看了博客并且用到PSMNet相关东西,请注明引用原作者的文章:

@inproceedings{chang2018pyramid,
title={Pyramid Stereo Matching Network},
author={Chang, Jia-Ren and Chen, Yong-Sheng},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={5410–5418},
year={2018}
}

这里开始看PSMNet源码
数据集如何组织输入不看,只看这个网络做了哪些工作。

if self.training:  
           w, h = left_img.size
           th, tw = 256, 512
           x1 = random.randint(0, w - tw)
           y1 = random.randint(0, h - th)
           left_img = left_img.crop((x1, y1, x1 + tw, y1 + th))
           right_img = right_img.crop((x1, y1, x1 + tw, y1 + th))
           dataL = dataL[y1:y1 + th, x1:x1 + tw]
           processed = preprocess.get_transform(augment=False)  
           left_img   = processed(left_img)
           right_img  = processed(right_img)
           return left_img, right_img, dataL
        else:
           w, h = left_img.size
           print('WARRING:\tw = %d\th = %d' % (w, h))
           left_img = left_img.crop((w-960, h-544, w, h))
           right_img = right_img.crop((w-960, h-544, w, h))
           processed = preprocess.get_transform(augment=False)  
           left_img       = processed(left_img)
           right_img      = processed(right_img)
           return left_img, right_img, dataL

这里,是dataloader/SceneFlowLoader.py,数据输入经过预处理,如果是训练阶段,就会随机进行图像裁剪(常见的数据集扩充手法,还可以避免过拟合),如果是测试阶段,就会在原图上面添加四行空白作为扩充。另外preprocess还对输入的左右图像进行了预处理。


未完待续,因为转头整理发展路线去了,发现PSMNet就是PSPNet结合了GCNet

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值