(data_path, postfix)
return (train_data, eval_data, test_data, attr_train, attr_eval, attr_test,
          attribute_names)
Load the CelebA dataset.
Load the CelebA dataset.
Load the CelebA dataset .
def _load_celeba(data_path, postfix):
  """Load the CelebA dataset."""
  with tf.gfile.Open(os.path.join(data_path, 'train' + postfix), 'rb') as f:
    train_data = np.load(f)
  with tf.gfile.Open(os.path.join(data_path, 'eval' + postfix), 'rb') as f:
    eval_data = np.load(f)
  with tf.gfile.Open(os.path.join(data_path, 'test' + postfix), 'rb') as f:
    test_data = np.load(f)
  with tf.gfile.Open(os.path.join(data_path, 'attr_train.npy'), 'rb') as f:
    attr_train = np.load(f)
  with tf.gfile.Open(os.path.join(data_path, 'attr_eval.npy'), 'rb') as f:
    attr_eval = np.load(f)
  with tf.gfile.Open(os.path.join(data_path, 'attr_test.npy'), 'rb') as f:
    attr_test = np.load(f)
  attr_mask = [4, 8, 9, 11, 15, 20, 24, 31, 35, 39]
  attribute_names = [
      'Bald',
      'Black_Hair',
      'Blond_Hair',
      'Brown_Hair',
      'Eyeglasses',
      'Male',
      'No_Beard',
      'Smiling',
      'Wearing_Hat',
      'Young',
  ]
  attr_train = attr_train[:, attr_mask]
  attr_eval = attr_eval[:, attr_mask]
  attr_test = attr_test[:, attr_mask]
  return (train_data, eval_data, test_data, attr_train, attr_eval, attr_test,
          attribute_names)
def _load_celeba ( data_path , postfix ) : with tf . gfile . Open ( os . path . join ( data_path , 'train' + postfix ) , 'rb' ) as f : train_data = np . load ( f ) with tf . gfile . Open ( os . path . join ( data_path , 'eval' + postfix ) , 'rb' ) as f : eval_data = np . load ( f ) with tf . gfile . Open ( os . path . join ( data_path , 'test' + postfix ) , 'rb' ) as f : test_data = np . load ( f ) with tf . gfile . Open ( os . path . join ( data_path , 'attr_train.npy' ) , 'rb' ) as f : attr_train = np . load ( f ) with tf . gfile . Open ( os . path . join ( data_path , 'attr_eval.npy' ) , 'rb' ) as f : attr_eval = np . load ( f ) with tf . gfile . Open ( os . path . join ( data_path , 'attr_test.npy' ) , 'rb' ) as f : attr_test = np . load ( f ) attr_mask = [ 4 , 8 , 9 , 11 , 15 , 20 , 24 , 31 , 35 , 39 ] attribute_names = [ 'Bald' , 'Black_Hair' , 'Blond_Hair' , 'Brown_Hair' , 'Eyeglasses' , 'Male' , 'No_Beard' , 'Smiling' , 'Wearing_Hat' , 'Young' , ] attr_train = attr_train [ : , attr_mask ] attr_eval = attr_eval [ : , attr_mask ] attr_test = attr_test [ : , attr_mask ] return ( train_data , eval_data , test_data , attr_train , attr_eval , attr_test , attribute_names )