"""Compile the Rockchip-exported YOLO-World v2 Medium graph with the Model Zoo recipe.""" import argparse from concurrent.futures import ThreadPoolExecutor from pathlib import Path import runpy parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--zoo", type=Path, required=True) args = parser.parse_args() root = Path(__file__).resolve().parent official = runpy.run_path(str(root.parent.parent / "convert-official.py")) source = "https://github.com/airockchip/YOLO-World/blob/master/RKNN_README_EN.md" model = root / "onnx/yolo_world/yolo_world_v2m.onnx" asset = ("yolo_world", "yolo_world_v2m", model, source) with ThreadPoolExecutor(4) as pool: jobs = [pool.submit(official["convert"], root, args.zoo.resolve(), asset, chip, precision) for chip in ("rk3576", "rk3588") for precision in ("fp", "i8")] for job in jobs: print(job.result(), flush=True)