Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion perceptionmetrics/cli/eval_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import click

from perceptionmetrics import cli
Expand Down Expand Up @@ -206,7 +208,12 @@ def eval_model(
predictions_outdir=predictions_outdir,
results_per_sample=predictions_outdir is not None,
)
results.to_csv(out_fname)

# Detection models return a dict with metrics_df and metrics_factory;
# other tasks return the metrics DataFrame directly.
metrics_df = results.get("metrics_df") if isinstance(results, dict) else results
os.makedirs(os.path.dirname(os.path.abspath(out_fname)), exist_ok=True)
metrics_df.to_csv(out_fname)

return results

Expand Down
1 change: 1 addition & 0 deletions perceptionmetrics/models/tf_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def t_in(image):

if "resize" in self.model_cfg:
tensor = resize_image(
tensor,
method="bilinear",
width=self.model_cfg["resize"].get("width", None),
height=self.model_cfg["resize"].get("height", None),
Expand Down