From 4a4db69bab65ec1279d03b913707dcebe5757d0d Mon Sep 17 00:00:00 2001 From: CarolinePascal Date: Tue, 30 Jun 2026 22:16:40 +0200 Subject: [PATCH] feat(warning): adding a warning when depth unit is not specified in the dataset --- src/lerobot/datasets/dataset_metadata.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lerobot/datasets/dataset_metadata.py b/src/lerobot/datasets/dataset_metadata.py index e5b694304..6e19d14fb 100644 --- a/src/lerobot/datasets/dataset_metadata.py +++ b/src/lerobot/datasets/dataset_metadata.py @@ -367,6 +367,16 @@ class LeRobotDatasetMetadata: ``output_unit`` on read. This converts the unit-bearing stat entries so stats match the frames consumers see. """ + missing_unit_keys = [ + key for key in self.depth_keys if (self.features[key].get("info") or {}).get("depth_unit") is None + ] + if missing_unit_keys: + logging.warning( + f"Depth feature(s) {missing_unit_keys} have no recorded 'depth_unit' in their info. " + f"Depth maps and stats for these keys will be returned AS IS, with no unit conversion " + f"to the requested output unit {output_unit!r}. Re-record the dataset or set 'depth_unit' " + f"in the feature info (meta/info.json) to enable conversion." + ) if self.stats is None: return for key in self.depth_keys: