def process_test_set(num_workers, failed_save_file): """ Extract video frames for the test set. :param num_workers: Number of worker processes. :param failed_save_file: Path to a log of failed extractions. :return: None. """ pool = parallel.Pool(None, config.TEST_ROOT, config.TEST_FRAMES_ROOT, num_workers, failed_save_file) pool.start_workers() pool.feed_videos() pool.stop_workers()
def process_classes(classes, train_root, valid_root, train_frames_root, valid_frames_root, num_workers, failed_save_file): """ Extract video frames for a class. :param classes: List of classes. :param num_workers: Number of worker processes. :param failed_save_file: Path to a log of failed extractions. :return: None. """ for source_root, target_root in zip( [train_root, valid_root], [train_frames_root, valid_frames_root]): pool = parallel.Pool(classes, source_root, target_root, num_workers, failed_save_file) pool.start_workers() pool.feed_videos() pool.stop_workers()
def process_classes(classes, num_workers, failed_save_file): """ Extract video frames for a class. :param classes: List of classes. :param num_workers: Number of worker processes. :param failed_save_file: Path to a log of failed extractions. :return: None. """ for source_root, target_root in zip( [config.TRAIN_ROOT, config.VALID_ROOT], [config.TRAIN_FRAMES_ROOT, config.VALID_FRAMES_ROOT]): pool = parallel.Pool(classes, source_root, target_root, num_workers, failed_save_file) pool.start_workers() pool.feed_videos() pool.stop_workers()