Datasets:
ArXiv:
License:
Update medianomaly.py
Browse files- medianomaly.py +5 -4
medianomaly.py
CHANGED
@@ -67,7 +67,8 @@ class Medianomaly(datasets.GeneratorBasedBuilder):
|
|
67 |
raise NotImplementedError(f"{config_name} is not implemented in Medianomaly.")
|
68 |
archive_path = dl_manager.download_and_extract(_URLS[config_name])
|
69 |
print(archive_path)
|
70 |
-
|
|
|
71 |
if config_name == "rsna":
|
72 |
data_dir = os.path.join(archive_path, config_name)
|
73 |
with open(os.path.join(data_dir, "data.json"), "r") as f:
|
@@ -80,10 +81,10 @@ class Medianomaly(datasets.GeneratorBasedBuilder):
|
|
80 |
"samples": metadata["test"], "base_dir": data_dir, "config": config_name
|
81 |
}),
|
82 |
]
|
83 |
-
|
84 |
-
|
85 |
def _generate_examples(self, samples, base_dir, config):
|
86 |
-
|
87 |
for label_str, items in samples.items(): # only "0" in train, "0"/"1" in test
|
88 |
label = int(label_str)
|
89 |
for idx, item in enumerate(items):
|
|
|
67 |
raise NotImplementedError(f"{config_name} is not implemented in Medianomaly.")
|
68 |
archive_path = dl_manager.download_and_extract(_URLS[config_name])
|
69 |
print(archive_path)
|
70 |
+
|
71 |
+
|
72 |
if config_name == "rsna":
|
73 |
data_dir = os.path.join(archive_path, config_name)
|
74 |
with open(os.path.join(data_dir, "data.json"), "r") as f:
|
|
|
81 |
"samples": metadata["test"], "base_dir": data_dir, "config": config_name
|
82 |
}),
|
83 |
]
|
84 |
+
|
85 |
+
|
86 |
def _generate_examples(self, samples, base_dir, config):
|
87 |
+
if config == "rsna":
|
88 |
for label_str, items in samples.items(): # only "0" in train, "0"/"1" in test
|
89 |
label = int(label_str)
|
90 |
for idx, item in enumerate(items):
|