From ccb57e095d6efe35c920ffdfe1c07faa826a3d24 Mon Sep 17 00:00:00 2001 From: Roooy Date: Tue, 10 Sep 2024 17:02:02 +0900 Subject: [PATCH] fix: division by zero error at create video indices --- sat/data_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sat/data_video.py b/sat/data_video.py index d5d0ea0..f3764c4 100644 --- a/sat/data_video.py +++ b/sat/data_video.py @@ -408,7 +408,7 @@ class SFTDataset(Dataset): num_frames = self.max_num_frames start = int(self.skip_frms_num) end = int(ori_vlen - self.skip_frms_num) - indices = np.arange(start, end, (end - start) // num_frames).astype(int) + indices = np.arange(start, end, max((end - start) // num_frames), 1).astype(int) temp_frms = vr.get_batch(np.arange(start, end)) assert temp_frms is not None tensor_frms = (