achouffe commited on
Commit
20dc17e
·
verified ·
1 Parent(s): b7f0113

fix: use absolute path for cache dir

Browse files
Files changed (1) hide show
  1. src/snowleopard_reid/cache.py +4 -2
src/snowleopard_reid/cache.py CHANGED
@@ -31,8 +31,10 @@ from snowleopard_reid.visualization import (
31
 
32
  logger = logging.getLogger(__name__)
33
 
34
- # Cache directory relative to project root
35
- CACHE_DIR = Path("cached_results")
 
 
36
 
37
 
38
  def get_cache_key(image_path: Path | str, extractor: str) -> str:
 
31
 
32
  logger = logging.getLogger(__name__)
33
 
34
+ # Cache directory - use absolute path based on module location
35
+ # This ensures consistent path resolution regardless of cwd
36
+ PROJECT_ROOT = Path(__file__).parent.parent.parent
37
+ CACHE_DIR = PROJECT_ROOT / "cached_results"
38
 
39
 
40
  def get_cache_key(image_path: Path | str, extractor: str) -> str: