(self, input_frames, gt_output_frames, generator)
return feed_dict
Builds a feed_dict with resized inputs and outputs for each scale network.

        @param input_frames: An array of shape
                             [batch_size x self.height x self.width x (3 * HIST_LEN)], The frames to
                             use for generation.
        @param gt_output_frames: An array of shape [batch_size x self.height x self.width x 3], The
                                 ground truth outputs for each sequence in input_frames.
        @param generator: The generator model.

        @return: The feed_dict needed to run this network, all scale_nets, and the generator
                 predictions.
Builds a feed_dict with resized inputs and outputs for each scale network.
Builds a feed_dict with resized inputs and outputs for each scale network .
def build_feed_dict(self, input_frames, gt_output_frames, generator):
        """
        Builds a feed_dict with resized inputs and outputs for each scale network.

        @param input_frames: An array of shape
                             [batch_size x self.height x self.width x (3 * HIST_LEN)], The frames to
                             use for generation.
        @param gt_output_frames: An array of shape [batch_size x self.height x self.width x 3], The
                                 ground truth outputs for each sequence in input_frames.
        @param generator: The generator model.

        @return: The feed_dict needed to run this network, all scale_nets, and the generator
                 predictions.
        """
        feed_dict = {}
        batch_size = np.shape(gt_output_frames)[0]

        ##
        # Get generated frames from GeneratorModel
        ##

        g_feed_dict = {generator.input_frames_train: input_frames,
                       generator.gt_frames_train: gt_output_frames}
        g_scale_preds = self.sess.run(generator.scale_preds_train, feed_dict=g_feed_dict)

        ##
        # Create discriminator feed dict
        ##
        for scale_num in xrange(self.num_scale_nets):
            scale_net = self.scale_nets[scale_num]

            # resize gt_output_frames
            scaled_gt_output_frames = np.empty([batch_size, scale_net.height, scale_net.width, 3])
            for i, img in enumerate(gt_output_frames):
                # for skimage.transform.resize, images need to be in range [0, 1], so normalize to
                # [0, 1] before resize and back to [-1, 1] after
                sknorm_img = (img / 2) + 0.5
                resized_frame = resize(sknorm_img, [scale_net.height, scale_net.width, 3])
                scaled_gt_output_frames[i] = (resized_frame - 0.5) * 2

            # combine with resized gt_output_frames to get inputs for prediction
            scaled_input_frames = np.concatenate([g_scale_preds[scale_num],
                                                  scaled_gt_output_frames])

            # convert to np array and add to feed_dict
            feed_dict[scale_net.input_frames] = scaled_input_frames

        # add labels for each image to feed_dict
        batch_size = np.shape(input_frames)[0]
        feed_dict[self.labels] = np.concatenate([np.zeros([batch_size, 1]),
                                                 np.ones([batch_size, 1])])

        return feed_dict
def build_feed_dict ( self , input_frames , gt_output_frames , generator ) : feed_dict = { } batch_size = np . shape ( gt_output_frames ) [ 0 ] ## # Get generated frames from GeneratorModel ## g_feed_dict = { generator . input_frames_train : input_frames , generator . gt_frames_train : gt_output_frames } g_scale_preds = self . sess . run ( generator . scale_preds_train , feed_dict = g_feed_dict ) ## # Create discriminator feed dict ## for scale_num in xrange ( self . num_scale_nets ) : scale_net = self . scale_nets [ scale_num ] # resize gt_output_frames scaled_gt_output_frames = np . empty ( [ batch_size , scale_net . height , scale_net . width , 3 ] ) for i , img in enumerate ( gt_output_frames ) : # for skimage.transform.resize, images need to be in range [0, 1], so normalize to # [0, 1] before resize and back to [-1, 1] after sknorm_img = ( img / 2 ) + 0.5 resized_frame = resize ( sknorm_img , [ scale_net . height , scale_net . width , 3 ] ) scaled_gt_output_frames [ i ] = ( resized_frame - 0.5 ) * 2 # combine with resized gt_output_frames to get inputs for prediction scaled_input_frames = np . concatenate ( [ g_scale_preds [ scale_num ] , scaled_gt_output_frames ] ) # convert to np array and add to feed_dict feed_dict [ scale_net . input_frames ] = scaled_input_frames # add labels for each image to feed_dict batch_size = np . shape ( input_frames ) [ 0 ] feed_dict [ self . labels ] = np . concatenate ( [ np . zeros ( [ batch_size , 1 ] ) , np . ones ( [ batch_size , 1 ] ) ] ) return feed_dict