Make YOLOX Nano conversion wrapper usable from the Hub checkout
Browse files
source/compile-yolox-nano.py
CHANGED
|
@@ -6,11 +6,14 @@ import runpy
|
|
| 6 |
|
| 7 |
parser = argparse.ArgumentParser(description=__doc__)
|
| 8 |
parser.add_argument("--zoo", type=Path, required=True)
|
|
|
|
|
|
|
| 9 |
args = parser.parse_args()
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
source = "https://github.com/airockchip/YOLOX/blob/main/README_rkopt.md"
|
| 13 |
-
model =
|
| 14 |
asset = ("yolox", "yolox_nano", model, source)
|
| 15 |
with ThreadPoolExecutor(4) as pool:
|
| 16 |
jobs = [pool.submit(official["convert"], root, args.zoo.resolve(), asset, chip, precision)
|
|
|
|
| 6 |
|
| 7 |
parser = argparse.ArgumentParser(description=__doc__)
|
| 8 |
parser.add_argument("--zoo", type=Path, required=True)
|
| 9 |
+
parser.add_argument("--onnx", type=Path, required=True, help="YOLOX Nano ONNX from the pinned Rockchip exporter")
|
| 10 |
+
parser.add_argument("--output-dir", type=Path, required=True)
|
| 11 |
args = parser.parse_args()
|
| 12 |
+
source_dir = Path(__file__).resolve().parent
|
| 13 |
+
root = args.output_dir.resolve()
|
| 14 |
+
official = runpy.run_path(str(source_dir / "convert-official.py"))
|
| 15 |
source = "https://github.com/airockchip/YOLOX/blob/main/README_rkopt.md"
|
| 16 |
+
model = args.onnx.resolve()
|
| 17 |
asset = ("yolox", "yolox_nano", model, source)
|
| 18 |
with ThreadPoolExecutor(4) as pool:
|
| 19 |
jobs = [pool.submit(official["convert"], root, args.zoo.resolve(), asset, chip, precision)
|