mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-22 20:19:43 +00:00
feat(is_depth): simplifying is_depth nested name + legacy support
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user