From 5a241ad8fcfa8615cd718a49fd96d64fbf4ed482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Kert=C3=A9sz?= Date: Thu, 2 Jul 2020 19:36:28 +0300 Subject: [PATCH] Update temporal.py Fix #12 --- vidaug/augmentors/temporal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vidaug/augmentors/temporal.py b/vidaug/augmentors/temporal.py index 606e0ca..592da11 100644 --- a/vidaug/augmentors/temporal.py +++ b/vidaug/augmentors/temporal.py @@ -130,7 +130,7 @@ def __init__(self , ratio=1.0): self.ratio = ratio def __call__(self, clip): - nb_return_frame = np.floor(self.ratio * len(clip)) + nb_return_frame = int(np.floor(self.ratio * len(clip))) return_ind = [int(i) for i in np.linspace(1, len(clip), num=nb_return_frame)] return [clip[i-1] for i in return_ind] @@ -150,7 +150,7 @@ def __init__(self , ratio=1.0): self.ratio = ratio def __call__(self, clip): - nb_return_frame = np.floor(self.ratio * len(clip)) + nb_return_frame = int(np.floor(self.ratio * len(clip))) return_ind = [int(i) for i in np.linspace(1, len(clip), num=nb_return_frame)] return [clip[i-1] for i in return_ind]