def stp_transformation(prev_image, stp_input, num_masks):
 from spatial_transformer import transformer
 identity_params = tf.convert_to_tensor(np.array([1.0, 0.0, 0.0, 0.0, 1.0, 0.0], np.float32))
 transformed = []
 for i in range((num_masks - 1)):
  params = (slim.layers.fully_connected(stp_input, 6, scope=('stp_params' + str(i)), activation_fn=None) + identity_params)
  transformed.append(transformer(prev_image, params))
 return transformed

def stp_transformation ( prev_image , stp_input , num_masks ) : from spatial_transformer import transformer identity_params = tf . convert_to_tensor ( np . array ( [ 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ] , np . float32 ) ) transformed = [ ] for i in range ( ( num_masks - 1 ) ) : params = ( slim . layers . fully_connected ( stp_input , 6 , scope = ( 'stp_params' + str ( i ) ) , activation_fn = None ) + identity_params ) transformed . append ( transformer ( prev_image , params ) ) return transformed
apply spatial transformer predictor to previous image .