(dataset_dir)
return photo_filenames, sorted(class_names)
Returns a list of filenames and inferred class names.

  Args:
    dataset_dir: A directory containing a set of subdirectories representing
      class names. Each subdirectory should contain PNG or JPG encoded images.

  Returns:
    A list of image file paths, relative to `dataset_dir` and the list of
    subdirectories, representing class names.
Returns a list of filenames and inferred class names.
Returns a list of filenames and inferred class names .
def _get_filenames_and_classes(dataset_dir):
  """Returns a list of filenames and inferred class names.

  Args:
    dataset_dir: A directory containing a set of subdirectories representing
      class names. Each subdirectory should contain PNG or JPG encoded images.

  Returns:
    A list of image file paths, relative to `dataset_dir` and the list of
    subdirectories, representing class names.
  """
  flower_root = os.path.join(dataset_dir, 'flower_photos')
  directories = []
  class_names = []
  for filename in os.listdir(flower_root):
    path = os.path.join(flower_root, filename)
    if os.path.isdir(path):
      directories.append(path)
      class_names.append(filename)

  photo_filenames = []
  for directory in directories:
    for filename in os.listdir(directory):
      path = os.path.join(directory, filename)
      photo_filenames.append(path)

  return photo_filenames, sorted(class_names)
def _get_filenames_and_classes ( dataset_dir ) : flower_root = os . path . join ( dataset_dir , 'flower_photos' ) directories = [ ] class_names = [ ] for filename in os . listdir ( flower_root ) : path = os . path . join ( flower_root , filename ) if os . path . isdir ( path ) : directories . append ( path ) class_names . append ( filename ) photo_filenames = [ ] for directory in directories : for filename in os . listdir ( directory ) : path = os . path . join ( directory , filename ) photo_filenames . append ( path ) return photo_filenames , sorted ( class_names )