Open1

Monocular-Depth-Estimation-Toolbox - DepthFormer のONNXエクスポート試行

PINTOPINTO
git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
git checkout 4f394b06743860543a0e7135f7e7496bdeb79764

docker build -t mmsegmentation -f docker/Dockerfile .

docker run --rm -it --gpus all \
-v `pwd`:/workdir \
mmsegmentation:latest

cat /etc/issue

Ubuntu 18.04.6 LTS \n \l

cd /workdir

git clone https://github.com/zhyever/Monocular-Depth-Estimation-Toolbox.git
cd Monocular-Depth-Estimation-Toolbox
pip install -e .

apt update
apt install wget nano
pip install gdown onnxruntime-gpu

## config
wget https://github.com/zhyever/Monocular-Depth-Estimation-Toolbox/raw/main/configs/depthformer/depthformer_swinl_22k_w7_kitti.py
wget https://github.com/zhyever/Monocular-Depth-Estimation-Toolbox/raw/main/configs/depthformer/depthformer_swint_w7_nyu.py
wget https://github.com/zhyever/Monocular-Depth-Estimation-Toolbox/raw/main/configs/depthformer/depthformer_swinl_22k_w7_nyu.py


## checkpoint
gdown --id 1BpcY9tULBRTW-cG8EVHBAZBapAv3ide4
gdown --id 1u8Kjgd9EmwwB_xMeBD7XaalpDygbSP73
gdown --id 1GMEgiiE-bkHYYD2xL8W6Qz50qa_P4T6e

MODEL=depthformer_swinl_22k_w7_kitti
H=224
W=224
python /mmsegmentation/tools/pytorch2onnx.py \
configs/depthformer/${MODEL}.py \
--checkpoint ${MODEL}.pth \
--shape ${H} ${W} \
--verify \
--output-file ${MODEL}_${H}x${W}.onnx \
--opset-version 11