JdeRobot / JdeRobot/PerceptionMetrics

Add computational cost tab to GUI evaluator

Open
#560 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
112
Forks
109
PR merge metrics
No merged PRs in 30d

Description

## Context

The GUI (`streamlit run app.py`) currently exposes three tabs: Dataset Viewer, Inference, and Evaluator. Computational cost information for a loaded model — parameter count, model file size, and forward-pass inference latency — is produced by `TorchImageDetectionModel.get_computational_cost()` but is only reachable via:

1. The CLI: `pm_evaluate computational-cost ...`
2. The standalone example scripts under `examples/`

This means a user who has already loaded a detection model in the GUI has to drop to a terminal, re-specify the model path, and read a CSV to get cost numbers. GUI ↔ CLI feature parity is missing for this capability.

This came up as a follow-up to #539 — the maintainer noted that fine-grained per-model cost reporting is a separate concern from aggregate evaluation-loop latency and deserves its own surface.

## Proposed change

Add a fourth tab, **Computational Cost**, that wraps `TorchImageDetectionModel.get_computational_cost()` for the model already loaded in the sidebar. The tab will let the user:

- Configure input image size (height, width)
- Configure `runs` and `warm_up_runs` for timing
- Trigger cost analysis with a button (gated — not recomputed on every widget change)
- View results as metrics (input shape, parameters in millions, model size in MB, inference latency in ms, derived FPS)
- Expand to see the full DataFrame
- Download the result as CSV (parity with the CLI's `results.to_csv(out_fname)` behavior)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.