separate pipeline
This commit is contained in:
@@ -103,7 +103,7 @@ def plot(by_k: dict[int, list[float]], na_by_k: dict[int, int],
|
||||
data_plot = [by_k[k] for k in ks]
|
||||
|
||||
fig, ax = plt.subplots(figsize=(8, 5))
|
||||
ax.boxplot(data_plot, labels=[str(k) for k in ks], patch_artist=True)
|
||||
ax.boxplot(data_plot, tick_labels=[str(k) for k in ks], patch_artist=True)
|
||||
ax.set_xlabel("Anzahl Kameras")
|
||||
ax.set_ylabel(metric)
|
||||
ax.set_title("Anzahl Kameras vs. Pose-Schätzfehler")
|
||||
@@ -126,8 +126,9 @@ def main() -> None:
|
||||
ap.add_argument("--metric",
|
||||
choices=["finger_error_mm", "wrist_error_mm",
|
||||
"mean_abs_deg", "max_abs_deg", "mean_abs_mm", "max_abs_mm"],
|
||||
default="finger_error_mm",
|
||||
help="Metrik für Tabelle und Plot (Standard: finger_error_mm)")
|
||||
default=None,
|
||||
help="Metrik für Tabelle und Plot. "
|
||||
"Standard: finger_error_mm + wrist_error_mm zusammen.")
|
||||
ap.add_argument("--out-plot", default=None,
|
||||
help="Plot-Pfad (Standard: results/camera_count_<metric>.png)")
|
||||
args = ap.parse_args()
|
||||
@@ -136,16 +137,22 @@ def main() -> None:
|
||||
if not data:
|
||||
return
|
||||
|
||||
by_k, na_by_k = group_by_k(data, args.metric)
|
||||
if not by_k and not na_by_k:
|
||||
print(f"[ERROR] Keine Werte für Metrik '{args.metric}' gefunden.")
|
||||
return
|
||||
# Ohne --metric: beide mm-Tabellen ausgeben, dann Plot für Finger
|
||||
metrics = [args.metric] if args.metric else ["finger_error_mm", "wrist_error_mm"]
|
||||
|
||||
out_plot = args.out_plot or str(RESULTS_DIR / f"camera_count_{args.metric}.png")
|
||||
for metric in metrics:
|
||||
by_k, na_by_k = group_by_k(data, metric)
|
||||
if not by_k and not na_by_k:
|
||||
print(f"[WARN] Keine Werte für Metrik '{metric}' — übersprungen.")
|
||||
continue
|
||||
print_table(by_k, na_by_k, metric)
|
||||
print_best_worst(data, metric)
|
||||
|
||||
print_table(by_k, na_by_k, args.metric)
|
||||
print_best_worst(data, args.metric)
|
||||
plot(by_k, na_by_k, args.metric, out_plot)
|
||||
# Plot für alle angezeigten Metriken
|
||||
for metric in metrics:
|
||||
by_k, na_by_k = group_by_k(data, metric)
|
||||
out_plot = args.out_plot or str(RESULTS_DIR / f"camera_count_{metric}.png")
|
||||
plot(by_k, na_by_k, metric, out_plot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 32 KiB |
Reference in New Issue
Block a user