From b81f23dfcac19f37a12f662798420b66789d4001 Mon Sep 17 00:00:00 2001 From: Konstantin Korotaev <42615530+KonstantinKorotaev@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:13:04 +0300 Subject: [PATCH] fix: Github-40: Fix ZeroDivisionError in extracting key frames --- label_studio_tools/postprocessing/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/label_studio_tools/postprocessing/video.py b/label_studio_tools/postprocessing/video.py index 41fa387..d203c3b 100644 --- a/label_studio_tools/postprocessing/video.py +++ b/label_studio_tools/postprocessing/video.py @@ -65,7 +65,7 @@ def _construct_result_from_frames( start_i = 1 if exclude_first else 0 for i in range(start_i, frame_count): frame_number = i + frame1['frame'] - delta = i / (frame_count - 1) + delta = i / max(1, (frame_count - 1)) deltas = {} for v in ["x", "y", "rotation", "width", "height", "time"]: deltas[v] = (