def frames_to_masks(
        nproc: int,
        out_paths: List[str],
        shapes: List[ImageSize],
        colors_list: List[List[NDArrayU8]],
        poly2ds_list: List[List[List[Poly2D]]],
        with_instances: bool=True,
        back_color: int=0,
        closed: bool=True, ) -> None:
    """Execute the mask conversion in parallel."""
    with Pool(nproc) as pool:
        pool.starmap(
            partial(
                frame_to_mask,
                with_instances=with_instances,
                back_color=back_color,
                closed=closed, ),
            tqdm(
                zip(out_paths, shapes, colors_list, poly2ds_list),
                total=len(out_paths), ), )
Execute the mask conversion in parallel.
deploy/pipeline/tools/lane_to_mask.py