def FilterInterpolate_ctx(ctx0,ctx2,offset,filter, timeoffset): ##TODO: which way should I choose ctx0_offset = FilterInterpolationModule()(ctx0,offset[0].detach(),filter[0].detach()) ctx2_offset = FilterInterpolationModule()(ctx2,offset[1].detach(),filter[1].detach()) return ctx0_offset, ctx2_offset
def FilterInterpolate(ref0, ref2, offset, filter,filter_size2, time_offset): ref0_offset = FilterInterpolationModule()(ref0, offset[0],filter[0]) ref2_offset = FilterInterpolationModule()(ref2, offset[1],filter[1]) # occlusion0, occlusion2 = torch.split(occlusion, 1, dim=1) # print((occlusion0[0,0,1,1] + occlusion2[0,0,1,1])) # output = (occlusion0 * ref0_offset + occlusion2 * ref2_offset) / (occlusion0 + occlusion2) # output = * ref0_offset + occlusion[1] * ref2_offset # automatically broadcasting the occlusion to the three channels of and image. # return output # return ref0_offset/2.0 + ref2_offset/2.0, ref0_offset,ref2_offset return ref0_offset*(1.0 - time_offset) + ref2_offset*(time_offset), ref0_offset, ref2_offset
def FilterInterpolate(ref0, ref2, offset, filter, filter_size2, time_offset): ref0_offset = FilterInterpolationModule()(ref0, offset[0], filter[0]) ref2_offset = FilterInterpolationModule()(ref2, offset[1], filter[1]) return ref0_offset * (1.0 - time_offset) + ref2_offset * ( time_offset), ref0_offset, ref2_offset
def FilterInterpolate(ref0, ref2, offset, filter, filter_size2): ref0_offset = FilterInterpolationModule()(ref0, offset[0], filter[0]) ref2_offset = FilterInterpolationModule()(ref2, offset[1], filter[1]) return ref0_offset / 2.0 + ref2_offset / 2.0, ref0_offset, ref2_offset
def FilterInterpolate_ctx(ctx0, ctx2, offset, filter): ctx0_offset = FilterInterpolationModule()(ctx0, offset[0].detach(), filter[0].detach()) ctx2_offset = FilterInterpolationModule()(ctx2, offset[1].detach(), filter[1].detach()) return ctx0_offset, ctx2_offset