68 lines
2.2 KiB
Markdown
68 lines
2.2 KiB
Markdown
# Exporting MMPose models
|
|
|
|
```bash
|
|
docker build --progress=plain -f extras/mmdeploy/dockerfile -t rpt_mmdeploy .
|
|
|
|
./extras/mmdeploy/run_container.sh
|
|
```
|
|
|
|
<br>
|
|
|
|
## ONNX
|
|
|
|
```bash
|
|
export withFP16="_fp16"
|
|
cp /RapidPoseTriangulation/extras/mmdeploy/configs/detection_onnxruntime_static-320x320$withFP16.py configs/mmdet/detection/
|
|
|
|
cd /mmdeploy/
|
|
python3 ./tools/deploy.py \
|
|
configs/mmdet/detection/detection_onnxruntime_static-320x320$withFP16.py \
|
|
/mmpose/projects/rtmpose/rtmdet/person/rtmdet_nano_320-8xb32_coco-person.py \
|
|
https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_nano_8xb32-100e_coco-obj365-person-05d8511e.pth \
|
|
/mmpose/projects/rtmpose/examples/onnxruntime/human-pose.jpeg \
|
|
--work-dir work_dir \
|
|
--show
|
|
|
|
mv /mmdeploy/work_dir/end2end.onnx /RapidPoseTriangulation/extras/mmdeploy/exports/rtmdet-nano_320x320$withFP16.onnx
|
|
```
|
|
|
|
```bash
|
|
export withFP16="_fp16"
|
|
cp /RapidPoseTriangulation/extras/mmdeploy/configs/pose-detection_simcc_onnxruntime_static-384x288$withFP16.py configs/mmpose/
|
|
|
|
cd /mmdeploy/
|
|
python3 ./tools/deploy.py \
|
|
configs/mmpose/pose-detection_simcc_onnxruntime_static-384x288$withFP16.py \
|
|
/mmpose/projects/rtmpose/rtmpose/body_2d_keypoint/rtmpose-m_8xb256-420e_coco-384x288.py \
|
|
https://download.openmmlab.com/mmpose/v1/projects/rtmposev1/rtmpose-m_simcc-body7_pt-body7_420e-384x288-65e718c4_20230504.pth \
|
|
/mmpose/projects/rtmpose/examples/onnxruntime/human-pose.jpeg \
|
|
--work-dir work_dir \
|
|
--show
|
|
|
|
mv /mmdeploy/work_dir/end2end.onnx /RapidPoseTriangulation/extras/mmdeploy/exports/rtmpose-m_384x288$withFP16.onnx
|
|
```
|
|
|
|
```bash
|
|
python3 /RapidPoseTriangulation/extras/mmdeploy/make_extra_graphs.py
|
|
python3 /RapidPoseTriangulation/extras/mmdeploy/add_extra_steps.py
|
|
```
|
|
|
|
<br>
|
|
|
|
## Benchmark
|
|
|
|
```bash
|
|
export withFP16="_fp16"
|
|
|
|
cd /mmdeploy/
|
|
python3 ./tools/profiler.py \
|
|
configs/mmpose/pose-detection_simcc_onnxruntime_static-384x288$withFP16.py \
|
|
/mmpose/projects/rtmpose/rtmpose/body_2d_keypoint/rtmpose-m_8xb256-420e_coco-384x288.py \
|
|
/RapidPoseTriangulation/extras/mmdeploy/testimages/ \
|
|
--model /RapidPoseTriangulation/extras/mmdeploy/exports/rtmpose-m_384x288$withFP16.onnx \
|
|
--shape 384x288 \
|
|
--device cuda \
|
|
--warmup 50 \
|
|
--num-iter 200
|
|
```
|