Exemple #1
0
 def __init__(self, args, addnoise=True):
     super(RandomAffineFlow, self).__init__()
     self._args = args
     self._interp2 = Interp2(clamp=False)
     self._flow_interp2 = Interp2(clamp=False)
     self._meshgrid = Meshgrid()
     self._identity = _IdentityParams()
     self._random_mirror = RandomMirror()
     self._addnoise = addnoise
     self.register_buffer("_noise1", torch.FloatTensor())
     self.register_buffer("_noise2", torch.FloatTensor())
     self.register_buffer("_xbounds", torch.FloatTensor([-1, -1, 1, 1]))
     self.register_buffer("_ybounds", torch.FloatTensor([-1, 1, -1, 1]))
Exemple #2
0
    def __init__(self, args, addnoise=True, crop=None):
        super(RandomAffineFlowOccKITTI, self).__init__()
        self._args = args
        self._interp2 = Interp2(clamp=False)
        self._flow_interp2 = Interp2MaskBinary(clamp=False)
        self._meshgrid = Meshgrid()
        self._identity = _IdentityParams()
        self._random_mirror = RandomMirror(vertical=False)
        self._addnoise = addnoise
        self._crop = crop

        self.register_buffer("_noise1", torch.FloatTensor())
        self.register_buffer("_noise2", torch.FloatTensor())
        self.register_buffer("_xbounds", torch.FloatTensor([-1, -1, 1, 1]))
        self.register_buffer("_ybounds", torch.FloatTensor([-1, 1, -1, 1]))
        self.register_buffer("_x", torch.IntTensor(1))
        self.register_buffer("_y", torch.IntTensor(1))