|
12 | 12 | sys.path.append("../") |
13 | 13 | from cnn_wrapper.mvsnet import * |
14 | 14 | from convgru import ConvGRUCell |
15 | | -from homography_warping import get_homographies, get_homographies_inv_depth, homography_warping |
| 15 | +from homography_warping import * |
16 | 16 |
|
17 | 17 | FLAGS = tf.app.flags.FLAGS |
18 | 18 |
|
@@ -108,7 +108,8 @@ def inference(images, cams, depth_num, depth_start, depth_interval, is_master_gp |
108 | 108 | for view in range(0, FLAGS.view_num - 1): |
109 | 109 | homography = tf.slice(view_homographies[view], begin=[0, d, 0, 0], size=[-1, 1, 3, 3]) |
110 | 110 | homography = tf.squeeze(homography, axis=1) |
111 | | - warped_view_feature = homography_warping(view_towers[view].get_output(), homography) |
| 111 | + # warped_view_feature = homography_warping(view_towers[view].get_output(), homography) |
| 112 | + warped_view_feature = tf_transform_homography(view_towers[view].get_output(), homography) |
112 | 113 | ave_feature = ave_feature + warped_view_feature |
113 | 114 | ave_feature2 = ave_feature2 + tf.square(warped_view_feature) |
114 | 115 | ave_feature = ave_feature / FLAGS.view_num |
@@ -201,16 +202,8 @@ def body(view, ave_feature, ave_feature2): |
201 | 202 | """Loop body.""" |
202 | 203 | homography = tf.slice(view_homographies[view], begin=[0, d, 0, 0], size=[-1, 1, 3, 3]) |
203 | 204 | homography = tf.squeeze(homography, axis=1) |
204 | | - |
205 | 205 | # warped_view_feature = homography_warping(view_features[view], homography) |
206 | | - ########## tf.contrib.image.transform ############# |
207 | | - homography = tf.reshape(homography, [-1, 9]) |
208 | | - homography_linear = tf.slice(homography, begin=[0, 0], size=[-1, 8]) |
209 | | - homography_linear_div = tf.tile(tf.slice(homography, begin=[0, 8], size=[-1, 1]), [1, 8]) |
210 | | - homography_linear = tf.div(homography_linear, homography_linear_div) |
211 | | - warped_view_feature = tf.contrib.image.transform( |
212 | | - view_features[view], homography_linear, interpolation='BILINEAR') |
213 | | - |
| 206 | + warped_view_feature = tf_transform_homography(view_features[view], homography) |
214 | 207 | ave_feature = tf.assign_add(ave_feature, warped_view_feature) |
215 | 208 | ave_feature2 = tf.assign_add(ave_feature2, tf.square(warped_view_feature)) |
216 | 209 | view = tf.add(view, 1) |
@@ -327,13 +320,8 @@ def body(depth_index, state1, state2, state3, depth_image, max_prob_image, exp_s |
327 | 320 | homographies = view_homographies[view] |
328 | 321 | homographies = tf.transpose(homographies, perm=[1, 0, 2, 3]) |
329 | 322 | homography = homographies[depth_index] |
330 | | - homography = tf.reshape(homography, [-1, 9]) |
331 | | - homography_linear = tf.slice(homography, begin=[0, 0], size=[-1, 8]) |
332 | | - homography_linear_div = tf.tile(tf.slice(homography, begin=[0, 8], size=[-1, 1]), [1, 8]) |
333 | | - homography_linear = tf.div(homography_linear, homography_linear_div) |
334 | | - warped_view_feature = tf.contrib.image.transform( |
335 | | - view_towers[view].get_output(), homography_linear, interpolation='BILINEAR') |
336 | | - |
| 323 | + # warped_view_feature = homography_warping(view_towers[view].get_output(), homography) |
| 324 | + warped_view_feature = tf_transform_homography(view_towers[view].get_output(), homography) |
337 | 325 | ave_feature = ave_feature + warped_view_feature |
338 | 326 | ave_feature2 = ave_feature2 + tf.square(warped_view_feature) |
339 | 327 | ave_feature = ave_feature / FLAGS.view_num |
|
0 commit comments