File: perceptionmetrics/cli/evaluate.py
Line: 197
Description
TorchImageDetectionModel.eval() returns a dict with keys metrics_df
and metrics_factory. The CLI calls .to_csv() directly on this dict,
which raises AttributeError every time detection evaluation is run with
--out_fname.
Bug
results = model.eval(...)
results.to_csv(out_fname) # results is a dict for detection models
Fix
if isinstance(results, dict):
results = results["metrics_df"]
results.to_csv(out_fname)
Steps to Reproduce
- Set up a COCO dataset and a torchscript detection model
- Run evaluation with
--out_fname:
pm_evaluate detection image --model_format torch --model model.pt
--dataset_format coco --dataset_dir /path/to/coco --out_fname results.csv
- Evaluation completes but crashes before saving with:
AttributeError: 'dict' object has no attribute 'to_csv'
File:
perceptionmetrics/cli/evaluate.pyLine: 197
Description
TorchImageDetectionModel.eval()returns adictwith keysmetrics_dfand
metrics_factory. The CLI calls.to_csv()directly on this dict,which raises
AttributeErrorevery time detection evaluation is run with--out_fname.Bug
Fix
Steps to Reproduce
--out_fname:pm_evaluate detection image --model_format torch --model model.pt
--dataset_format coco --dataset_dir /path/to/coco --out_fname results.csv
AttributeError: 'dict' object has no attribute 'to_csv'