Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
feat(preprocessor): add frame selector
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmyshin committed Sep 25, 2019
1 parent 80364c0 commit 09199d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gnes/preprocessor/video/frame_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down
2 changes: 1 addition & 1 deletion gnes/preprocessor/video/shotdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 09199d8

Please sign in to comment.