def build_fcrn_module(self, image): batch, heigth, width, _ = image.get_shape().as_list() with tf.variable_scope("FCRN") as scope: # crop out boarder and flip color channels fcrn_input = tf.image.resize_area(image[:, 4:-4, 6:-6, ::-1], [228, 304]) net = fcrn.ResNet50UpProj({'data': fcrn_input}, batch, 1, False) dpred = tf.stop_gradient(net.get_output()) dpred = tf.image.resize_bilinear(dpred, [heigth, width]) return dpred
def _build_fcrn_graph(self): image = self.placeholders['keyframe'] batch, height, width, _ = image.get_shape().as_list() with tf.variable_scope("FCRN") as scope: # crop out boarder and flip color channels fcrn_input = tf.image.resize_area(image[:, 4:-4, 6:-6, ::-1], [228, 304]) net = fcrn.ResNet50UpProj({'data': fcrn_input}, batch, 1, False) dpred = tf.stop_gradient(net.get_output()) dpred = tf.image.resize_bilinear(dpred, [height, width]) self.outputs['fcrn'] = dpred[0]
def _build_fcrn_graph(self): """ Build single image initializion graph""" images = self.images_placeholder batch, ht, wd, _ = tf.unstack(tf.shape(images), num=4) with tf.variable_scope("FCRN") as scope: # crop out boarder and flip color channels fcrn_input = tf.image.resize_area(images[:, 4:-4, 6:-6, ::-1], [228, 304]) net = fcrn.ResNet50UpProj({'data': fcrn_input}, batch, 1, False) fcrn_output = tf.stop_gradient(net.get_output()) fcrn_output = tf.image.resize_bilinear(fcrn_output, [ht, wd]) self.outputs['fcrn'] = tf.squeeze(fcrn_output, -1)