Adapted code for obfuscation check
This commit is contained in:
@@ -14,7 +14,7 @@ class Visualizer:
|
||||
|
||||
_PTN = re.compile(r"results_(?P<dataset>[^_]+)_(?P<technique>[^.]+)\.json$")
|
||||
|
||||
def __init__(self, json_dir: str | Path):
|
||||
def __init__(self, json_dir):
|
||||
self.json_dir = Path(json_dir)
|
||||
if not self.json_dir.exists():
|
||||
raise FileNotFoundError(self.json_dir)
|
||||
@@ -59,6 +59,7 @@ class Visualizer:
|
||||
"""
|
||||
sub = self.df[(self.df["dataset"] == dataset) &
|
||||
(self.df["category"] == category)]
|
||||
|
||||
if sub.empty:
|
||||
print(f"[⚠] Kein Eintrag für Dataset={dataset}, Cat={category}")
|
||||
return
|
||||
@@ -146,11 +147,12 @@ class Visualizer:
|
||||
|
||||
for cat, metrics in data.items():
|
||||
for metric, val in metrics.items():
|
||||
recs.append({"dataset": dataset,
|
||||
"technique": tech,
|
||||
"category": cat,
|
||||
"metric": metric,
|
||||
"value": val})
|
||||
if cat == "face" and metric == "\mathrm{Acc}_\mathrm{deID}" and tech != "NO_OP": #TODO: This is just for a single bar chart, i can remove this if statement
|
||||
recs.append({"dataset": dataset,
|
||||
"technique": tech,
|
||||
"category": cat,
|
||||
"metric": metric,
|
||||
"value": val})
|
||||
if not recs:
|
||||
raise RuntimeError("Keine passenden JSON-Dateien gefunden.")
|
||||
return pd.DataFrame.from_records(recs)
|
||||
|
||||
Reference in New Issue
Block a user