File size: 831 Bytes
e8055cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Tests for encoder/run.py -- combined cache loading and source provenance."""

from encoder import run


def test_cache_or_load_exposes_explicit_dimensions():
    assert "frame_count" in run.cache_or_load.__code__.co_varnames


def test_video_mode_preserves_depth_and_tracking():
    assert run._effective_dimensions("relative", None, "tracking", True) == (
        "relative",
        "video",
        "tracking",
    )


def test_video_mode_selects_caches_for_requested_axes(tmp_path, monkeypatch):
    monkeypatch.setattr(run.config, "CACHE_ROOT", tmp_path)
    da3_path, sam3_path = run._cache_source_paths(
        "scene", "relative", "video", "tracking", 32, True, None, None
    )
    assert da3_path.endswith("depth-anything-3/relative/video/scene.npz")
    assert sam3_path.endswith("sam3/tracking/video/scene.pkl.gz")