parameters: (sess, logits, keep_prob, image_pl, data_folder, image_shape)
docstring: Generate test output using the test images
      :param sess: TF session
      :param logits: TF Tensor for the logits
      :param keep_prob: TF Placeholder for the dropout keep robability
      :param image_pl: TF Placeholder for the image placeholder
      :param data_folder: Path to the folder that contains the datasets
      :param image_shape: Tuple - Shape of image
      :return: Output for for each test image
docstring_summary: Generate test output using the test images
      :param sess: TF session
      :param logits: TF Tensor for the logits
      :param keep_prob: TF Placeholder for the dropout keep robability
      :param image_pl: TF Placeholder for the image placeholder
      :param data_folder: Path to the folder that contains the datasets
      :param image_shape: Tuple - Shape of image
      :return: Output for for each test image
docstring_tokens: Generate test output using the test images : param sess : TF session : param logits : TF Tensor for the logits : param keep_prob : TF Placeholder for the dropout keep robability : param image_pl : TF Placeholder for the image placeholder : param data_folder : Path to the folder that contains the datasets : param image_shape : Tuple - Shape of image : return : Output for for each test image
function: def gen_test_output(sess, logits, keep_prob, image_pl, data_folder, image_shape):
      """
      Generate test output using the test images
      :param sess: TF session
      :param logits: TF Tensor for the logits
      :param keep_prob: TF Placeholder for the dropout keep robability
      :param image_pl: TF Placeholder for the image placeholder
      :param data_folder: Path to the folder that contains the datasets
      :param image_shape: Tuple - Shape of image
      :return: Output for for each test image
      """
      for image_file in glob(os.path.join(data_folder, 'image_2', '*.png')):
          image = scipy.misc.imresize(scipy.misc.imread(image_file), image_shape)
  
          im_softmax = sess.run(
              [tf.nn.softmax(logits)],
              {keep_prob: 1.0, image_pl: [image]})
          im_softmax = im_softmax[0][:, 1].reshape(image_shape[0], image_shape[1])
          segmentation = (im_softmax > 0.5).reshape(image_shape[0], image_shape[1], 1)
          mask = np.dot(segmentation, np.array([[0, 255, 0, 127]]))
          mask = scipy.misc.toimage(mask, mode="RGBA")
          street_im = scipy.misc.toimage(image)
          street_im.paste(mask, box=None, mask=mask)
  
          yield os.path.basename(image_file), np.array(street_im)
function_tokens: def gen_test_output ( sess , logits , keep_prob , image_pl , data_folder , image_shape ) : for image_file in glob ( os . path . join ( data_folder , 'image_2' , '*.png' ) ) : image = scipy . misc . imresize ( scipy . misc . imread ( image_file ) , image_shape ) im_softmax = sess . run ( [ tf . nn . softmax ( logits ) ] , { keep_prob : 1.0 , image_pl : [ image ] } ) im_softmax = im_softmax [ 0 ] [ : , 1 ] . reshape ( image_shape [ 0 ] , image_shape [ 1 ] ) segmentation = ( im_softmax > 0.5 ) . reshape ( image_shape [ 0 ] , image_shape [ 1 ] , 1 ) mask = np . dot ( segmentation , np . array ( [ [ 0 , 255 , 0 , 127 ] ] ) ) mask = scipy . misc . toimage ( mask , mode = "RGBA" ) street_im = scipy . misc . toimage ( image ) street_im . paste ( mask , box = None , mask = mask ) yield os . path . basename ( image_file ) , np . array ( street_im )