Skip to content
Permalink
Browse files

feat(preprocessor): add frame selector

  • Loading branch information...
jemmyshin committed Sep 25, 2019
1 parent 80364c0 commit 09199d825f0b4830bfe9eabd7350764644433c99
Showing with 2 additions and 2 deletions.
  1. +1 −1 gnes/preprocessor/video/frame_select.py
  2. +1 −1 gnes/preprocessor/video/shotdetect.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]))
@@ -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:

0 comments on commit 09199d8

Please sign in to comment.
You can’t perform that action at this time.