(dataset_dir, filename=LABELS_FILENAME)
return labels_to_class_names
Reads the labels file and returns a mapping from ID to class name.

  Args:
    dataset_dir: The directory in which the labels file is found.
    filename: The filename where the class names are written.

  Returns:
    A map from a label (integer) to class name.
Reads the labels file and returns a mapping from ID to class name.
Reads the labels file and returns a mapping from ID to class name .
def read_label_file(dataset_dir, filename=LABELS_FILENAME):
  """Reads the labels file and returns a mapping from ID to class name.

  Args:
    dataset_dir: The directory in which the labels file is found.
    filename: The filename where the class names are written.

  Returns:
    A map from a label (integer) to class name.
  """
  labels_filename = os.path.join(dataset_dir, filename)
  with tf.gfile.Open(labels_filename, 'r') as f:
    lines = f.read().decode()
  lines = lines.split('\n')
  lines = filter(None, lines)

  labels_to_class_names = {}
  for line in lines:
    index = line.index(':')
    labels_to_class_names[int(line[:index])] = line[index+1:]
  return labels_to_class_names
def read_label_file ( dataset_dir , filename = LABELS_FILENAME ) : labels_filename = os . path . join ( dataset_dir , filename ) with tf . gfile . Open ( labels_filename , 'r' ) as f : lines = f . read ( ) . decode ( ) lines = lines . split ( '\n' ) lines = filter ( None , lines ) labels_to_class_names = { } for line in lines : index = line . index ( ':' ) labels_to_class_names [ int ( line [ : index ] ) ] = line [ index + 1 : ] return labels_to_class_names