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

Commit

Permalink
fix(video-decoder): minor revision video-decoder chunk spliter
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 29, 2019
1 parent a087626 commit 9365ddb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gnes/preprocessor/video/video_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ def apply(self, doc: 'gnes_pb2.Document') -> None:
else:
self.logger.error('the document "raw_bytes" is empty!')

if self.chunk_spliter == 'frame_split':
if self.chunk_spliter == 'base':
for i, frame in enumerate(video_frames):
c = doc.chunks.add()
c.doc_id = doc.doc_id
c.blob.CopyFrom(array2blob(frame))
c.offset = i
c.weight = 1.0
elif self.chunk_spliter == 'none':
elif self.chunk_spliter == 'shot':
raise NotImplemented
else:
chunk = doc.chunks.add()
chunk.doc_id = doc.doc_id
chunk.blob.CopyFrom(array2blob(video_frames))
Expand Down

0 comments on commit 9365ddb

Please sign in to comment.