From d44b143991fa45681f550a026c2ab6f1a0791ff1 Mon Sep 17 00:00:00 2001 From: Niklas Freund Date: Fri, 25 Oct 2024 11:06:32 +0200 Subject: [PATCH] feat: Implement validate_empty_frames --- .../validate_empty_frames/validate_empty_frames.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raillabel_providerkit/validation/validate_empty_frames/validate_empty_frames.py b/raillabel_providerkit/validation/validate_empty_frames/validate_empty_frames.py index 65060e4..1bdc2e9 100644 --- a/raillabel_providerkit/validation/validate_empty_frames/validate_empty_frames.py +++ b/raillabel_providerkit/validation/validate_empty_frames/validate_empty_frames.py @@ -17,9 +17,16 @@ def validate_empty_frames(scene: raillabel.Scene) -> List[str]: Returns ------- list[str] - list of all onthology errors in the scene. If an empty list is returned, then there are no + list of all empty frame errors in the scene. If an empty list is returned, then there are no errors present. """ + errors: List[str] = [] + + for frame_uid, frame in scene.frames.items(): + if _is_frame_empty(frame): + errors.append("Frame " + str(frame_uid) + " has no annotations!") + + return errors def _is_frame_empty(frame: raillabel.format.Frame) -> bool: