@staticmethod
def _get_original_labels(val_path):
    'Returns labels for validation.\n\n    Args:\n      val_path: path to TAR file containing validation images. It is used to\n      retrieve the name of pictures and associate them to labels.\n\n    Returns:\n      dict, mapping from image name (str) to label (str).\n    '
    labels_path = os.fspath(tfds.core.tfds_path(_VALIDATION_LABELS_FNAME))
    with tf.io.gfile.GFile(labels_path) as labels_f:
        labels = labels_f.read().strip().splitlines()
    with tf.io.gfile.GFile(val_path, 'rb') as tar_f_obj:
        tar = tarfile.open(mode='r:', fileobj=tar_f_obj)
        images = sorted(tar.getnames())
    return dict(zip(images, labels))
Returns labels for validation.

Args:
  val_path: path to TAR file containing validation images. It is used to
  retrieve the name of pictures and associate them to labels.

Returns:
  dict, mapping from image name (str) to label (str).
@staticmethod
def _get_original_labels(val_path):
    'Returns labels for validation.\n\n    Args:\n      val_path: path to TAR file containing validation images. It is used to\n      retrieve the name of pictures and associate them to labels.\n\n    Returns:\n      dict, mapping from image name (str) to label (str).\n    '
    labels_path = os.fspath(tfds.core.tfds_path(_VALIDATION_LABELS_FNAME))
    with tf.io.gfile.GFile(labels_path) as labels_f:
        labels = labels_f.read().strip().splitlines()
    with tf.io.gfile.GFile(val_path, 'rb') as tar_f_obj:
        tar = tarfile.open(mode='r:', fileobj=tar_f_obj)
        images = sorted(tar.getnames())
    return dict(zip(images, labels))