From 09199d825f0b4830bfe9eabd7350764644433c99 Mon Sep 17 00:00:00 2001 From: Jem Date: Wed, 25 Sep 2019 14:35:25 +0800 Subject: [PATCH] feat(preprocessor): add frame selector --- gnes/preprocessor/video/frame_select.py | 2 +- gnes/preprocessor/video/shotdetect.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gnes/preprocessor/video/frame_select.py b/gnes/preprocessor/video/frame_select.py index cb01d51c..d55aacbb 100644 --- a/gnes/preprocessor/video/frame_select.py +++ b/gnes/preprocessor/video/frame_select.py @@ -35,7 +35,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: for chunk in doc.chunks: images = blob2array(chunk.blob) if len(images) == 0: - self.logger.info("this chunk has no frame!") + self.logger.warning("this chunk has no frame!") elif self.sframes == 1: idx = [int(len(images) / 2)] chunk.blob.CopyFrom(array2blob(images[idx])) diff --git a/gnes/preprocessor/video/shotdetect.py b/gnes/preprocessor/video/shotdetect.py index 78c27241..1fd6bec4 100644 --- a/gnes/preprocessor/video/shotdetect.py +++ b/gnes/preprocessor/video/shotdetect.py @@ -106,7 +106,7 @@ def apply(self, doc: 'gnes_pb2.Document') -> None: else: idx = np.sort(np.random.choice(shot_len, self.sframes, replace=False)) frames = [frames[idx_] for idx_ in idx] - + chunk_data = np.array(frames) c.blob.CopyFrom(array2blob(chunk_data)) else: