示例#1
0
    def call(self, x):
        # TODO offsets probably have no nonlinearity?
        x_shape = x.get_shape()
        offsets = super(ConvOffset2D, self).call(x)

        offsets = self._to_bc_h_w_2(offsets, x_shape)
        x = self._to_bc_h_w(x, x_shape)
        x_offset = tf_batch_map_offsets(x, offsets)
        x_offset = self._to_b_h_w_c(x_offset, x_shape)
        return x_offset
示例#2
0
    def call(self, x):
        '''
        return the deformed featureed map
        '''
        x_shape = x.get_shape()
        offsets = super(ConvOffset2D, self).call(x)

        #offsets: (b*c, h, w, 2)
        offsets = self._to_bc_h_w_2(offsets, x_shape)
        #x: (b*c, h, w)
        x = self._to_bc_h_w(x, x_shape)
        #X_offset: (b*c, h, w)
        x_offset = tf_batch_map_offsets(x, offsets)
        #x_offset: (b, h, w, c)
        x_offset = self._to_b_h_w_c(x_offset, x_shape)

        return x_offset