phase cv 0
This commit is contained in:
@@ -161,3 +161,36 @@ def test_all_serialized_is_json_compatible():
|
||||
|
||||
roundtrip = json.loads(json_str)
|
||||
assert roundtrip["frame_meta"]["sequence"] == frame.sequence
|
||||
|
||||
|
||||
# --- OverrideProfile ---
|
||||
|
||||
def test_override_profile_region_analysis():
|
||||
"""OverrideProfile must patch region_analysis_config with overrides."""
|
||||
from detect.checkpoint.replay import OverrideProfile
|
||||
from detect.profiles.soccer import SoccerBroadcastProfile
|
||||
from detect.profiles.base import RegionAnalysisConfig
|
||||
|
||||
base = SoccerBroadcastProfile()
|
||||
original = base.region_analysis_config()
|
||||
|
||||
overrides = {"region_analysis": {"edge_canny_low": 25, "edge_canny_high": 200}}
|
||||
wrapped = OverrideProfile(base, overrides)
|
||||
patched = wrapped.region_analysis_config()
|
||||
|
||||
assert isinstance(patched, RegionAnalysisConfig)
|
||||
assert patched.edge_canny_low == 25
|
||||
assert patched.edge_canny_high == 200
|
||||
# Unmodified fields keep their defaults
|
||||
assert patched.edge_hough_threshold == original.edge_hough_threshold
|
||||
|
||||
|
||||
def test_override_profile_passthrough():
|
||||
"""OverrideProfile without region_analysis key passes through unchanged."""
|
||||
from detect.checkpoint.replay import OverrideProfile
|
||||
from detect.profiles.soccer import SoccerBroadcastProfile
|
||||
|
||||
base = SoccerBroadcastProfile()
|
||||
wrapped = OverrideProfile(base, {"ocr": {"min_confidence": 0.1}})
|
||||
config = wrapped.region_analysis_config()
|
||||
assert config.edge_canny_low == base.region_analysis_config().edge_canny_low
|
||||
|
||||
Reference in New Issue
Block a user