- dcase23-task2-enriched.py +0 -21
dcase23-task2-enriched.py
CHANGED
@@ -113,27 +113,6 @@ class DCASE2023Task2DatasetConfig(datasets.BuilderConfig):
|
|
113 |
description=description,
|
114 |
)
|
115 |
|
116 |
-
def to_spotlight(self, data: Union[pd.DataFrame, datasets.Dataset]) -> pd.DataFrame:
|
117 |
-
if type(data) == datasets.Dataset:
|
118 |
-
df = data.to_pandas()
|
119 |
-
df["split"] = data.split
|
120 |
-
df["config"] = data.config_name
|
121 |
-
|
122 |
-
class_names = data.features["class"].names
|
123 |
-
df["class_name"] = df["class"].apply(lambda x: class_names[x])
|
124 |
-
elif type(data) == pd.DataFrame:
|
125 |
-
df = data
|
126 |
-
else:
|
127 |
-
raise TypeError("type(data) not in Union[pd.DataFrame, datasets.Dataset]")
|
128 |
-
|
129 |
-
df["file_path"] = df["path"]
|
130 |
-
df.rename(columns=self._rename, inplace=True)
|
131 |
-
|
132 |
-
return df.copy()
|
133 |
-
|
134 |
-
def get_layout(self):
|
135 |
-
return self._layout
|
136 |
-
|
137 |
|
138 |
class DCASE2023Task2Dataset(datasets.GeneratorBasedBuilder):
|
139 |
"""Dataset for the DCASE 2023 Challenge Task 2 "First-Shot Unsupervised Anomalous Sound Detection
|
|
|
113 |
description=description,
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
class DCASE2023Task2Dataset(datasets.GeneratorBasedBuilder):
|
118 |
"""Dataset for the DCASE 2023 Challenge Task 2 "First-Shot Unsupervised Anomalous Sound Detection
|