yangwang825 commited on
Commit
2d848d0
1 Parent(s): f9901c4

Update audioset.py

Browse files
Files changed (1) hide show
  1. audioset.py +6 -4
audioset.py CHANGED
@@ -21,6 +21,8 @@ from tqdm.auto import tqdm
21
  from rich.logging import RichHandler
22
  from huggingface_hub import hf_hub_download
23
 
 
 
24
  logger = logging.getLogger(__name__)
25
  logger.addHandler(RichHandler())
26
  logger.setLevel(logging.INFO)
@@ -32,11 +34,11 @@ _HOMEPAGE = "https://huggingface.co/datasets/confit/audioset"
32
  _BALANCED_TRAIN_FILENAME = 'balanced/balanced_train_segments.zip'
33
  _EVAL_FILENAME = 'eval/eval_segments.zip'
34
 
35
- ID2LABEL = json.load(
36
- open(hf_hub_download("huggingface/label-files", "audioset-id2label.json", repo_type="dataset"), "r")
37
- )
38
  LABEL2ID = {v:k for k, v in ID2LABEL.items()}
39
- CLASSES = list(set(LABEL2ID.keys()))
40
 
41
  # Cache location
42
  VERSION = "0.0.1"
 
21
  from rich.logging import RichHandler
22
  from huggingface_hub import hf_hub_download
23
 
24
+ from ._audioset import ID2LABEL
25
+
26
  logger = logging.getLogger(__name__)
27
  logger.addHandler(RichHandler())
28
  logger.setLevel(logging.INFO)
 
34
  _BALANCED_TRAIN_FILENAME = 'balanced/balanced_train_segments.zip'
35
  _EVAL_FILENAME = 'eval/eval_segments.zip'
36
 
37
+ # ID2LABEL = json.load(
38
+ # open(hf_hub_download("huggingface/label-files", "audioset-id2label.json", repo_type="dataset"), "r")
39
+ # )
40
  LABEL2ID = {v:k for k, v in ID2LABEL.items()}
41
+ CLASSES = list(ID2LABEL.values())
42
 
43
  # Cache location
44
  VERSION = "0.0.1"