Files
Mini-Nav/mini-nav/commands/benchmark.py
SikongJueluo ab616528b4 refactor(benchmark): delegate model loading to tasks and support CIFAR-100
- Extract model loading logic from benchmark CLI into task-owned prepare_benchmark
- Add RetrievalEncoder class wrapping DINO with optional hash compression
- Add accelerate dependency for device management  
- Switch dataset from CIFAR-10 to CIFAR-100 with fine_label column
2026-05-15 09:59:40 +08:00

27 lines
657 B
Python

import typer
from commands import app
@app.command()
def benchmark(
_ctx: typer.Context,
model_path: str | None = typer.Option(
None, "--model", "-m", help="Path to compressor model weights"
),
):
from benchmarks import run_benchmark
from configs import cfg_manager
config = cfg_manager.get()
benchmark_cfg = config.benchmark
if model_path:
config.model.compressor_path = model_path
_ = run_benchmark(
model=None,
processor=None,
config=benchmark_cfg,
model_config=config.model,
model_name="hash_compressor" if config.model.compressor_path else "dinov2",
)