organize settings to dedicated sensors folder, json + assets

This commit is contained in:
ykcheungab
2026-08-23 12:21:24 +08:00
parent 44bcc19426
commit 1ceb0d9ca4
34 changed files with 688 additions and 98 deletions
+9 -4
View File
@@ -4,6 +4,7 @@ import sys
from dataclasses import dataclass
from pathlib import Path
from ..configs import resolve_sensor_asset_dir
from ..unroll import (
compute_uv_distortion_metrics,
load_exported_data,
@@ -11,7 +12,7 @@ from ..unroll import (
scaled_map_cache_path,
)
DEFAULT_FINGER_EXPORT_DIR = "assets/finger/30fps-0703"
DEFAULT_FINGER_EXPORT_DIR = "sensors/finger/assets/30fps-0703"
DEFAULT_FINGER_MAP_CACHE = f"{DEFAULT_FINGER_EXPORT_DIR}/unroll_map_uv.npz"
@@ -44,11 +45,15 @@ def _candidate_export_dirs(export_dir) -> list[Path]:
return [raw]
here = Path(__file__).resolve()
candidates = [
candidates = []
bundled_assets = resolve_sensor_asset_dir("finger")
if bundled_assets is not None and raw.as_posix() == DEFAULT_FINGER_EXPORT_DIR:
candidates.append(bundled_assets)
candidates.extend([
Path.cwd() / raw,
here.parents[1] / raw, # packaged wheel: orisys/assets/...
here.parents[1] / raw, # packaged wheel filesystem layout
here.parents[3] / raw, # editable install: repo/assets/...
]
])
if getattr(sys, "frozen", False):
candidates.insert(0, Path(sys.executable).resolve().parent / raw)
unique: list[Path] = []