feat(benchmarks): add evaluation framework for DINO-based compressors

This commit is contained in:
2026-02-08 22:43:38 +08:00
parent 3ba3705ba6
commit 7f6732edeb
11 changed files with 217 additions and 42 deletions

View File

@@ -0,0 +1,3 @@
from .common import get_device, get_output_diretory
__all__ = ["get_device", "get_output_diretory"]

23
mini-nav/utils/common.py Normal file
View File

@@ -0,0 +1,23 @@
from functools import lru_cache
from pathlib import Path
import torch
from configs import cfg_manager
from torch.types import Device
@lru_cache(maxsize=1)
def get_device() -> Device:
config = cfg_manager.get()
device = config.model.device
if device == "auto":
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
else:
device = torch.device(device)
return device
@lru_cache(maxsize=1)
def get_output_diretory() -> Path:
config = cfg_manager.get()
return config.output.directory