From fefd4fc8227956f24a6b70048f40d328628339e1 Mon Sep 17 00:00:00 2001 From: Shunsuke Miura Date: Tue, 9 Jul 2024 12:26:21 +0900 Subject: [PATCH 1/3] add nbr_samples checker, sample token checker Signed-off-by: Shunsuke Miura --- perception_dataset/t4_dataset/format_validator.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/perception_dataset/t4_dataset/format_validator.py b/perception_dataset/t4_dataset/format_validator.py index ae5cf196..27d8e475 100644 --- a/perception_dataset/t4_dataset/format_validator.py +++ b/perception_dataset/t4_dataset/format_validator.py @@ -70,6 +70,10 @@ def validate_scene(nusc: NuScenes): nusc, "sample", scene["last_sample_token"] ), "scene.last_sample_token isn't found in log" + assert nusc.scene[0]["nbr_samples"] == len( + nusc.sample + ), "scene.nbr_samples isn't equal to the number of samples." + @_logger_wrapper def validate_sample(nusc: NuScenes): @@ -77,6 +81,9 @@ def validate_sample(nusc: NuScenes): no_next_token_count: int = 0 no_prev_token_count: int = 0 + sample_annotation_refered_sample_tokens = [ + ann["sample_token"] for ann in nusc.sample_annotation + ] for sample in nusc.sample: assert find_in_table( nusc, "scene", sample["scene_token"] @@ -96,6 +103,10 @@ def validate_sample(nusc: NuScenes): nusc, "sample", prev_token ), "sample.prev_token isn't found in sample." + assert ( + sample["token"] in sample_annotation_refered_sample_tokens + ), "sample.token isn't found in sample_annotation." + assert no_next_token_count == len( nusc.scene ), f"There are more than {len(nusc.scene)} sample of empty scene.next." From fa0069677f3b33aa52269a39b5e3516eaac01d47 Mon Sep 17 00:00:00 2001 From: Shunsuke Miura <37187849+miursh@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:24:04 +0900 Subject: [PATCH 2/3] Update perception_dataset/t4_dataset/format_validator.py Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> --- perception_dataset/t4_dataset/format_validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception_dataset/t4_dataset/format_validator.py b/perception_dataset/t4_dataset/format_validator.py index 27d8e475..d7dfcf5c 100644 --- a/perception_dataset/t4_dataset/format_validator.py +++ b/perception_dataset/t4_dataset/format_validator.py @@ -81,7 +81,7 @@ def validate_sample(nusc: NuScenes): no_next_token_count: int = 0 no_prev_token_count: int = 0 - sample_annotation_refered_sample_tokens = [ + sample_annotation_referred_sample_tokens = [ ann["sample_token"] for ann in nusc.sample_annotation ] for sample in nusc.sample: From 64e3c6e4d88dc51f2373a4473ca81183ea9c2c5d Mon Sep 17 00:00:00 2001 From: Shunsuke Miura <37187849+miursh@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:24:11 +0900 Subject: [PATCH 3/3] Update perception_dataset/t4_dataset/format_validator.py Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> --- perception_dataset/t4_dataset/format_validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception_dataset/t4_dataset/format_validator.py b/perception_dataset/t4_dataset/format_validator.py index d7dfcf5c..41b1cb80 100644 --- a/perception_dataset/t4_dataset/format_validator.py +++ b/perception_dataset/t4_dataset/format_validator.py @@ -104,7 +104,7 @@ def validate_sample(nusc: NuScenes): ), "sample.prev_token isn't found in sample." assert ( - sample["token"] in sample_annotation_refered_sample_tokens + sample["token"] in sample_annotation_referred_sample_tokens ), "sample.token isn't found in sample_annotation." assert no_next_token_count == len(