fix(info): fixing info metadata update when is_depth_map was set

This commit is contained in:
CarolinePascal
2026-05-22 02:48:30 +02:00
parent 8a615070e7
commit a94d9f119c
2 changed files with 7 additions and 4 deletions
+7 -3
View File
@@ -577,9 +577,13 @@ class LeRobotDatasetMetadata:
video_keys = [video_key] if video_key is not None else self.video_keys
for key in video_keys:
if not self.features[key].get("info", None):
video_path = self.root / self.video_path.format(video_key=key, chunk_index=0, file_index=0)
self.info.features[key]["info"] = get_video_info(video_path, video_encoder=video_encoder)
existing = self.features[key].get("info") or {}
# Skip only if real video info has already been written. The ``is_depth_map`` entry (created at feature creation) is not blocking.
if set(existing.keys()) - {"is_depth_map"}:
continue
video_path = self.root / self.video_path.format(video_key=key, chunk_index=0, file_index=0)
new_info = get_video_info(video_path, video_encoder=video_encoder)
self.info.features[key]["info"] = {**existing, **new_info}
def update_chunk_settings(
self,
-1
View File
@@ -969,7 +969,6 @@ def get_video_info(
# Calculate fps from r_frame_rate
video_info["video.fps"] = int(video_stream.base_rate)
video_info["video.channels"] = get_pix_fmt_channels(video_stream.pix_fmt)
# Reset logging level