From b31b9b30750f795ec82ac8b268d180742baa1ccc Mon Sep 17 00:00:00 2001 From: swdee Date: Fri, 19 Dec 2025 14:52:52 +1300 Subject: [PATCH] add midas model building to toolkit --- toolkit/Dockerfile | 11 +++++++++-- toolkit/compile-models.sh | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/toolkit/Dockerfile b/toolkit/Dockerfile index 1984a27..f1bfaf6 100644 --- a/toolkit/Dockerfile +++ b/toolkit/Dockerfile @@ -8,6 +8,8 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ wget \ git \ + git-lfs \ + ca-certificates \ libgl1-mesa-glx && \ rm -rf /var/lib/apt/lists/* @@ -89,10 +91,15 @@ RUN pip install --no-cache-dir \ pyyaml \ "tensorflow<=2.16.0rc0" +# fixes for python package conflicts, we are forcing specific versions. +RUN pip install --no-cache-dir \ + "ml-dtypes==0.5.4" "onnx==1.18.0" "onnxruntime==1.18.1" + # download other onnx models RUN git clone --depth 1 https://github.com/swdee/go-rknnlite-build.git /opt/go-rknnlite-build && \ - git -C /opt/go-rknnlite-build fetch --depth 1 origin ce8b5ce1dc53b1c38324e7506374731ad21070c8 && \ - git -C /opt/go-rknnlite-build checkout FETCH_HEAD + git -C /opt/go-rknnlite-build fetch --depth 1 origin 8380b2265b4becf2dda4c7ff52b9d57f8c718f09 && \ + git -C /opt/go-rknnlite-build checkout FETCH_HEAD && \ + git -C /opt/go-rknnlite-build lfs pull # copy our modified mobilenet.py script into the rknn_model_zoo directory RUN cp /opt/go-rknnlite-build/mobilenet-batch/mobilenet-rknn.py /opt/rknn_model_zoo/examples/mobilenet/python/mobilenet-rknn-batch.py diff --git a/toolkit/compile-models.sh b/toolkit/compile-models.sh index 08867b9..df7b304 100755 --- a/toolkit/compile-models.sh +++ b/toolkit/compile-models.sh @@ -32,6 +32,7 @@ MODELS=( "yolov8 convert.py /opt/go-rknnlite-build/yolonas-s.onnx i8 '' yolonas-s" "mobilenet mobilenet-rknn-batch.py ../model/mobilenetv2-12.onnx i8 --model mobilenetv2-batch8" "osnet-market1501 build|onnx_to_rknn.py osnet_x1_0_market_256x128.onnx i8 '' osnet-market1501-batch8" + "midas build|onnx_to_rknn.py dpt_swin2_tiny_256.onnx i8 '' dpt_swin2_tiny_256" ) # compile all entries (or just filter) for one platform