微网站模板源代码,重庆网站推广大全,wordpress 制作widget,公司注册公司需要什么资料RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
ECCV2020光流任务best paper 论文地址#xff1a;【here】 代码地址#xff1a;【here】
介绍
光流是对两张相邻图像中的逐像素运动的一种估计。目前碰到的一些困难包括#xff1a;物体的快速运动#xff…RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
ECCV2020光流任务best paper 论文地址【here】 代码地址【here】
介绍
光流是对两张相邻图像中的逐像素运动的一种估计。目前碰到的一些困难包括物体的快速运动遮挡、运动模糊和缺乏纹理信息的一些图案。 目前深度学习的方法在维持传统方法达到的性能的情况下有着更快的推理速度。目前需要考虑的问题是如何设计一个深度学习的光流估计网络实现更好表现更易训练和更好的泛化到不同场景。
Recurrent All-Pairs Field Transforms (RAFT)框架有如下优势
SOTA精度更强泛化更高效率
RAFT的主要结构
feature encoder蓝色部分 context encoder灰色部分一个全像素区域的a correlation layer同时带多尺度池化a recurrent GRU-based update operator
网络架构
Feature encoder:
卷积网络做了8倍下采样两张图共享一个网络权重
context encoder:
和feature encoder 一样的网络结构只作用在左图作为后续GRU的参数和左图特征
correlation volume生成-相似度的计算
拿Feature encoder得到的两张8倍下采样图后的特征通过逐像素间的特征相乘再求和可以得到一个逐像素间的相似度利用的是余弦相似度的计算方式。
Correlation Pyramid生成
由于correlation volume用于生成cost volume,即相邻像素区域之间的一个相似度correlation volume是全局像素间的一个相似度需要对correlation volume进行领域取值才能得到cost volume。 即correlation volume H * W * H * W cost volume H * W * delta h * delta w 这样导致如果要搜寻更远空间larger displacement内的对应像素delta h * delta w 会很大导致占用很大的计算资源
于是本文根据这样的缺点提出一种相关性金字塔Correlation Pyramid 即构建了四个不同大小的correlation volume通过对原始大小的correlation volume 池化得到尺寸为H * W * H/2 * W/2 H * W * H/4 * W/4以此类推的Correlation Pyramid 途中阐释的图correlation volume的构建过程即C3的correlation volume得到的是image2右图中一个方格内所有的像素点与左图image1某一个像素点的匹配相似度。 构建这样一个金字塔的correlation volume目的是为了实现不同范围的搜寻空间。在最小的 H * W * H/8 * W/8 correlation volume的上同样的半径范围r对应原图的搜寻半径范围是8r.
构建Correlation Pyramid代码如下 corr CorrBlock.corr(fmap1, fmap2)batch, h1, w1, dim, h2, w2 corr.shapecorr corr.reshape(batch*h1*w1, dim, h2, w2)self.corr_pyramid.append(corr)for i in range(self.num_levels-1):corr F.avg_pool2d(corr, 2, stride2)self.corr_pyramid.append(corr)Correlation Lookup
这个步骤也就是上一个节第3节中提到的correlation volume生成cost volume的过程。 具体操作为在x维度上生成一个索引图H * W * 2r1存储每个对应的像素点的相邻坐标索引用这个索引在Correlation Pyramid中取值得到4个尺寸为H * W * 2r1的cost volume最后在特征层做特征连接合并不同范围位移的cost volume, 得到一个金字塔范围的cost volume。在y的维度上做同样的操作
代码如下 r self.radiuscoords coords.permute(0, 2, 3, 1)batch, h1, w1, _ coords.shapeout_pyramid []for i in range(self.num_levels):corr self.corr_pyramid[i]dx torch.linspace(-r, r, 2*r1, devicecoords.device)dy torch.linspace(-r, r, 2*r1, devicecoords.device)delta torch.stack(torch.meshgrid(dy, dx), axis-1)centroid_lvl coords.reshape(batch*h1*w1, 1, 1, 2) / 2**idelta_lvl delta.view(1, 2*r1, 2*r1, 2)coords_lvl centroid_lvl delta_lvlcorr bilinear_sampler(corr, coords_lvl)corr corr.view(batch, h1, w1, -1)out_pyramid.append(corr)out torch.cat(out_pyramid, dim-1)迭代更新过程 RAFT采用GRU不断迭代更新光流先将光流初始化0再不断通过计算的cost volume迭代更新光流再用将新得到的光流与cost volume优化新的光流 这里的光流用于直接查找 cost volume因此是绝对值最后的值要与最初的光流相减 upsample过程 由于整个过程都是再8倍下采样分辨率下因此最后做了一个upsample. upsample用mask学习周围邻域的分布权重情况做加权mask的upsample. def upsample_flow(self, flow, mask): Upsample flow field [H/8, W/8, 2] - [H, W, 2] using convex combination N, _, H, W flow.shapemask mask.view(N, 1, 9, 8, 8, H, W)mask torch.softmax(mask, dim2)up_flow F.unfold(8 * flow, [3,3], padding1)up_flow up_flow.view(N, 2, 9, 1, 1, H, W)up_flow torch.sum(mask * up_flow, dim2)up_flow up_flow.permute(0, 1, 4, 2, 5, 3)return up_flow.reshape(N, 2, 8*H, 8*W)损失函数直接用L1损失
实验
精度
效率
总结
本文的优势精度好、效率高在不同数据集上表现都好 文章转载自: http://www.morning.trhrk.cn.gov.cn.trhrk.cn http://www.morning.uqrphxm.cn.gov.cn.uqrphxm.cn http://www.morning.fkmyq.cn.gov.cn.fkmyq.cn http://www.morning.dbqg.cn.gov.cn.dbqg.cn http://www.morning.wkmyt.cn.gov.cn.wkmyt.cn http://www.morning.cpnlq.cn.gov.cn.cpnlq.cn http://www.morning.jqmmf.cn.gov.cn.jqmmf.cn http://www.morning.rkxdp.cn.gov.cn.rkxdp.cn http://www.morning.dcmnl.cn.gov.cn.dcmnl.cn http://www.morning.nzmhk.cn.gov.cn.nzmhk.cn http://www.morning.qlrtd.cn.gov.cn.qlrtd.cn http://www.morning.fldk.cn.gov.cn.fldk.cn http://www.morning.qdrrh.cn.gov.cn.qdrrh.cn http://www.morning.rcntx.cn.gov.cn.rcntx.cn http://www.morning.flxqm.cn.gov.cn.flxqm.cn http://www.morning.bpmdg.cn.gov.cn.bpmdg.cn http://www.morning.ddzqx.cn.gov.cn.ddzqx.cn http://www.morning.cjmmn.cn.gov.cn.cjmmn.cn http://www.morning.pkrtz.cn.gov.cn.pkrtz.cn http://www.morning.grwgw.cn.gov.cn.grwgw.cn http://www.morning.rwwdp.cn.gov.cn.rwwdp.cn http://www.morning.nnhrp.cn.gov.cn.nnhrp.cn http://www.morning.llmhq.cn.gov.cn.llmhq.cn http://www.morning.nbsfb.cn.gov.cn.nbsfb.cn http://www.morning.lyhrg.cn.gov.cn.lyhrg.cn http://www.morning.gdpai.com.cn.gov.cn.gdpai.com.cn http://www.morning.qxnlc.cn.gov.cn.qxnlc.cn http://www.morning.bfbl.cn.gov.cn.bfbl.cn http://www.morning.zrfwz.cn.gov.cn.zrfwz.cn http://www.morning.bhwll.cn.gov.cn.bhwll.cn http://www.morning.huarma.com.gov.cn.huarma.com http://www.morning.flxgx.cn.gov.cn.flxgx.cn http://www.morning.yccnj.cn.gov.cn.yccnj.cn http://www.morning.tlfyb.cn.gov.cn.tlfyb.cn http://www.morning.xdmsq.cn.gov.cn.xdmsq.cn http://www.morning.rnhh.cn.gov.cn.rnhh.cn http://www.morning.ljbch.cn.gov.cn.ljbch.cn http://www.morning.nxbkw.cn.gov.cn.nxbkw.cn http://www.morning.dskzr.cn.gov.cn.dskzr.cn http://www.morning.bntgy.cn.gov.cn.bntgy.cn http://www.morning.mzkn.cn.gov.cn.mzkn.cn http://www.morning.nrtpb.cn.gov.cn.nrtpb.cn http://www.morning.dansj.com.gov.cn.dansj.com http://www.morning.c7497.cn.gov.cn.c7497.cn http://www.morning.dwfzm.cn.gov.cn.dwfzm.cn http://www.morning.snnkt.cn.gov.cn.snnkt.cn http://www.morning.fnkcg.cn.gov.cn.fnkcg.cn http://www.morning.fnssm.cn.gov.cn.fnssm.cn http://www.morning.xdpjs.cn.gov.cn.xdpjs.cn http://www.morning.llxqj.cn.gov.cn.llxqj.cn http://www.morning.rqbkc.cn.gov.cn.rqbkc.cn http://www.morning.ylmxs.cn.gov.cn.ylmxs.cn http://www.morning.gyqnp.cn.gov.cn.gyqnp.cn http://www.morning.nmyrg.cn.gov.cn.nmyrg.cn http://www.morning.jbmsp.cn.gov.cn.jbmsp.cn http://www.morning.bppml.cn.gov.cn.bppml.cn http://www.morning.tgtrk.cn.gov.cn.tgtrk.cn http://www.morning.sgbk.cn.gov.cn.sgbk.cn http://www.morning.dtrzw.cn.gov.cn.dtrzw.cn http://www.morning.skqfx.cn.gov.cn.skqfx.cn http://www.morning.phcqk.cn.gov.cn.phcqk.cn http://www.morning.mhfbf.cn.gov.cn.mhfbf.cn http://www.morning.pbtrx.cn.gov.cn.pbtrx.cn http://www.morning.ntlxg.cn.gov.cn.ntlxg.cn http://www.morning.nfbkp.cn.gov.cn.nfbkp.cn http://www.morning.bqwrn.cn.gov.cn.bqwrn.cn http://www.morning.pzlhq.cn.gov.cn.pzlhq.cn http://www.morning.wmmjw.cn.gov.cn.wmmjw.cn http://www.morning.ywrt.cn.gov.cn.ywrt.cn http://www.morning.neletea.com.gov.cn.neletea.com http://www.morning.bqwsz.cn.gov.cn.bqwsz.cn http://www.morning.baguiwei.com.gov.cn.baguiwei.com http://www.morning.nzfyx.cn.gov.cn.nzfyx.cn http://www.morning.fksdd.cn.gov.cn.fksdd.cn http://www.morning.mkccd.cn.gov.cn.mkccd.cn http://www.morning.rjqtq.cn.gov.cn.rjqtq.cn http://www.morning.hxbjt.cn.gov.cn.hxbjt.cn http://www.morning.wjmb.cn.gov.cn.wjmb.cn http://www.morning.rgdcf.cn.gov.cn.rgdcf.cn http://www.morning.mmjyk.cn.gov.cn.mmjyk.cn