def _augment_images_worker(self, augseq, queue_source, queue_result, seedval):
np.random.seed(seedval)<EOL>random.seed(seedval)<EOL>augseq.reseed(seedval)<EOL>ia.seed(seedval)<EOL>loader_finished = False<EOL>while not loader_finished:<EOL><INDENT>try:<EOL><INDENT>batch_str = queue_source.get(timeout=<NUM_LIT:0.1>)<EOL>batch = pickle.loads(batch_str)<EOL>if batch is None:<EOL><INDENT>loader_finished = True<EOL>queue_source.put(pickle.dumps(None, protocol=-<NUM_LIT:1>))<EOL><DEDENT>else:<EOL><INDENT>batch_aug = augseq.augment_batch(batch)<EOL>batch_str = pickle.dumps(batch_aug, protocol=-<NUM_LIT:1>)<EOL>queue_result.put(batch_str)<EOL><DEDENT><DEDENT>except QueueEmpty:<EOL><INDENT>time.sleep(<NUM_LIT>)<EOL><DEDENT><DEDENT>queue_result.put(pickle.dumps(None, protocol=-<NUM_LIT:1>))<EOL>time.sleep(<NUM_LIT>)<EOL>
Augment endlessly images in the source queue.

This is a worker function for that endlessly queries the source queue (input batches),
augments batches in it and sends the result to the output queue.