(img, config)
return x
Post process image `img` according to the dataset in `config`.
Post process image `img` according to the dataset in `config`.
Post process image img according to the dataset in config .
def post_proc(img, config):
  """Post process image `img` according to the dataset in `config`."""
  x = img
  x = np.minimum(1., np.maximum(0., x))  # clipping
  if dataset_is_mnist_family(config['dataset']):
    x = np.reshape(x, (-1, 28, 28))
    x = np.stack((x,) * 3, -1)  # grey -> rgb
  return x
def post_proc ( img , config ) : x = img x = np . minimum ( 1. , np . maximum ( 0. , x ) ) # clipping if dataset_is_mnist_family ( config [ 'dataset' ] ) : x = np . reshape ( x , ( - 1 , 28 , 28 ) ) x = np . stack ( ( x , ) * 3 , - 1 ) # grey -> rgb return x