queue_manager.get_queue("in").put(feed)
for index, _ in enumerate(tqdm(landmarks, desc="Aligning...", file=sys.stdout)):
face = queue_manager.get_queue("out").get()
landmarks[index] = np.array(face["detected_faces"][0].landmarks_xy)
return filename_list, image_list, landmarks
After Change
// TODO thread the put to queue so we don"t have to put and get at the same time
// Or even better, set up a proper background loader from disk (i.e. use lib.image.ImageIO)
for idx, feed in enumerate(tqdm(feed_list, desc="Aligning...", file=sys.stdout)):
extractor.input_queue.put(feed)
landmarks[idx] = next(extractor.detected_faces()).detected_faces[0].landmarks_xy
return filename_list, image_list, landmarks