mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 09:46:00 +00:00
fix(info): fixing info metadata update when is_depth_map was set
This commit is contained in:
@@ -619,9 +619,13 @@ class LeRobotDatasetMetadata:
|
|||||||
|
|
||||||
video_keys = [video_key] if video_key is not None else self.video_keys
|
video_keys = [video_key] if video_key is not None else self.video_keys
|
||||||
for key in video_keys:
|
for key in video_keys:
|
||||||
if not self.features[key].get("info", None):
|
existing = self.features[key].get("info") or {}
|
||||||
video_path = self.root / self.video_path.format(video_key=key, chunk_index=0, file_index=0)
|
# Skip only if real video info has already been written. The ``is_depth_map`` entry (created at feature creation) is not blocking.
|
||||||
self.info.features[key]["info"] = get_video_info(video_path, video_encoder=video_encoder)
|
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(
|
def update_chunk_settings(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -1146,7 +1146,6 @@ def get_video_info(
|
|||||||
|
|
||||||
# Calculate fps from r_frame_rate
|
# Calculate fps from r_frame_rate
|
||||||
video_info["video.fps"] = int(video_stream.base_rate)
|
video_info["video.fps"] = int(video_stream.base_rate)
|
||||||
|
|
||||||
video_info["video.channels"] = get_pix_fmt_channels(video_stream.pix_fmt)
|
video_info["video.channels"] = get_pix_fmt_channels(video_stream.pix_fmt)
|
||||||
|
|
||||||
# Reset logging level
|
# Reset logging level
|
||||||
|
|||||||
Reference in New Issue
Block a user