feat(is_depth): simplifying is_depth nested name + legacy support

This commit is contained in:
CarolinePascal
2026-05-21 14:26:16 +02:00
parent e87933302d
commit 15647f50a2
8 changed files with 37 additions and 38 deletions
+4 -4
View File
@@ -59,7 +59,7 @@ DEPTH_FEATURES = {
"dtype": "video",
"shape": (64, 96, 1),
"names": ["height", "width", "channels"],
"info": {"video.is_depth_map": True},
"info": {"is_depth_map": True},
},
}
@@ -155,7 +155,7 @@ def test_create_without_videos_has_no_video_path(tmp_path):
def test_depth_keys_property_filters_by_marker(tmp_path):
"""``depth_keys`` selects only video features carrying ``video.is_depth_map=True``."""
"""``depth_keys`` selects only features carrying ``is_depth_map=True`` in info."""
features = {
**VIDEO_FEATURES,
**DEPTH_FEATURES,
@@ -164,8 +164,8 @@ def test_depth_keys_property_filters_by_marker(tmp_path):
repo_id="test/depth_keys", fps=DEFAULT_FPS, features=features, root=tmp_path / "depth_keys"
)
assert set(meta.video_keys) == {"observation.images.laptop", "observation.depth.laptop"}
assert meta.depth_keys == ["observation.depth.laptop"]
assert set(meta.video_keys) == {"observation.images.laptop", "observation.images.laptop_depth"}
assert meta.depth_keys == ["observation.images.laptop_depth"]
def test_depth_keys_empty_when_no_marker(tmp_path):
+2 -2
View File
@@ -368,7 +368,7 @@ class TestGetVideoInfo:
assert info["video.pix_fmt"] == "yuv420p"
assert info["video.fps"] == 30
assert info["video.channels"] == 3
assert info["video.is_depth_map"] is False
assert info["is_depth_map"] is False
assert info["has_audio"] is False
assert "video.g" not in info
assert "video.crf" not in info
@@ -463,7 +463,7 @@ class TestEncodeVideoFrames:
assert info["video.codec"] == "av1"
assert info["video.pix_fmt"] == "yuv420p"
assert info["video.fps"] == 30
assert info["video.is_depth_map"] is False
assert info["is_depth_map"] is False
assert info["has_audio"] is False
# Encoder config
assert info["video.g"] == 4