The dataset viewer is not available for this split.
The info cannot be fetched for the config 'default' of the dataset.
Error code:   InfoError
Exception:    DatasetNotFoundError
Message:      Dataset 'huggingface/label-files' doesn't exist on the Hub
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 210, in compute_first_rows_from_streaming_response
                  info = get_dataset_config_info(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 477, in get_dataset_config_info
                  builder = load_dataset_builder(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 2220, in load_dataset_builder
                  dataset_module = dataset_module_factory(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1865, in dataset_module_factory
                  raise e1 from None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1808, in dataset_module_factory
                  raise DatasetNotFoundError(msg + f" at revision '{revision}'" if revision else msg)
              datasets.exceptions.DatasetNotFoundError: Dataset 'huggingface/label-files' doesn't exist on the Hub

Need help to make the dataset viewer work? Open a discussion for direct support.

YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

This repository contains the mapping from integer id's to actual label names (in HuggingFace Transformers typically called id2label) for several datasets.

Current datasets include:

  • ImageNet-1k
  • ImageNet-22k (also called ImageNet-21k as there are 21,843 classes)
  • COCO detection 2017
  • COCO panoptic 2017
  • ADE20k (actually, the MIT Scene Parsing benchmark, which is a subset of ADE20k)
  • Cityscapes
  • VQAv2
  • Kinetics-700
  • RVL-CDIP
  • PASCAL VOC
  • Kinetics-400
  • ...

You can read in a label file as follows (using the huggingface_hub library):

from huggingface_hub import hf_hub_download
import json

repo_id = "huggingface/label-files"
filename = "imagenet-22k-id2label.json"
id2label = json.load(open(hf_hub_download(repo_id, filename, repo_type="dataset"), "r"))
id2label = {int(k):v for k,v in id2label.items()}

To add an id2label mapping for a new dataset, simply define a Python dictionary, and then save that dictionary as a JSON file, like so:

import json

# simple example
id2label = {0: 'cat', 1: 'dog'}

with open('cats-and-dogs-id2label.json', 'w') as fp:
    json.dump(id2label, fp)

You can then upload it to this repository (assuming you have write access).

Downloads last month
110
Edit dataset card

Spaces using huggingface/label-files 2