Skip to content

Instantly share code, notes, and snippets.

@gaiar
Created February 13, 2020 07:20
Show Gist options
  • Save gaiar/51875bdc7f7e70ed22e5d99833bf8b3d to your computer and use it in GitHub Desktop.
Save gaiar/51875bdc7f7e70ed22e5d99833bf8b3d to your computer and use it in GitHub Desktop.
def get_batch(self,bs=5):
bsize = bs if self.Q.qsize() > bs else self.Q.qsize()
if self.more() or not self.stopped:
frames = []
for i in range(bsize):
frames.append(self.Q.get())
return frames
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment