Switched to onnx backend.

This commit is contained in:
Isse
2024-12-06 16:51:49 +01:00
parent 39bb132a98
commit 0f55599da2
3 changed files with 277 additions and 19 deletions

View File

@ -54,7 +54,7 @@ Tested with a _Jetson AGX Orin Developer Kit_ module.
```bash
docker run --rm hello-world
docker run -it --rm --runtime=nvidia --network=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r36.2.0
docker run -it --rm --runtime=nvidia --network=host dustynv/l4t-pytorch:r36.4.0
docker run -it --rm --runtime=nvidia --network=host dustynv/onnxruntime:1.20-r36.4.0
```
- Check _cuda_ access in container:

273
extras/jetson/RESULTS.md Normal file
View File

@ -0,0 +1,273 @@
# Evaluation Results
Results of the model in various experiments on different datasets.
### Human36m
```json
{
"avg_time_2d": 0.08326671446784067,
"avg_time_3d": 0.002362334122092037,
"avg_fps": 11.678279934988891
}
{
"person_nums": {
"total_frames": 600,
"total_labels": 600,
"total_preds": 600,
"considered_empty": 0,
"valid_preds": 600,
"invalid_preds": 0,
"missing": 0,
"invalid_fraction": 0.0,
"precision": 1.0,
"recall": 1.0,
"f1": 1.0,
"non_empty": 600
},
"mpjpe": {
"count": 600,
"mean": 0.067047,
"median": 0.059492,
"std": 0.027809,
"sem": 0.001136,
"min": 0.043579,
"max": 0.192515,
"recall-0.025": 0.0,
"recall-0.05": 0.051667,
"recall-0.1": 0.933333,
"recall-0.15": 0.95,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600,
"ap-0.025": 0.0,
"ap-0.05": 0.0071,
"ap-0.1": 0.893961,
"ap-0.15": 0.916148,
"ap-0.25": 1.0,
"ap-0.5": 1.0
},
"nose": {
"count": 600,
"mean": 0.114127,
"median": 0.096429,
"std": 0.04375,
"sem": 0.001788,
"min": 0.022879,
"max": 0.278748,
"recall-0.025": 0.001667,
"recall-0.05": 0.011667,
"recall-0.1": 0.535,
"recall-0.15": 0.818333,
"recall-0.25": 0.988333,
"recall-0.5": 1.0,
"num_labels": 600
},
"shoulder_left": {
"count": 600,
"mean": 0.03394,
"median": 0.025359,
"std": 0.032048,
"sem": 0.001309,
"min": 0.002731,
"max": 0.180682,
"recall-0.025": 0.485,
"recall-0.05": 0.865,
"recall-0.1": 0.943333,
"recall-0.15": 0.965,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"shoulder_right": {
"count": 600,
"mean": 0.047462,
"median": 0.034253,
"std": 0.040799,
"sem": 0.001667,
"min": 0.005133,
"max": 0.252418,
"recall-0.025": 0.238333,
"recall-0.05": 0.76,
"recall-0.1": 0.915,
"recall-0.15": 0.945,
"recall-0.25": 0.998333,
"recall-0.5": 1.0,
"num_labels": 600
},
"elbow_left": {
"count": 600,
"mean": 0.043416,
"median": 0.035385,
"std": 0.034844,
"sem": 0.001424,
"min": 0.002309,
"max": 0.195554,
"recall-0.025": 0.258333,
"recall-0.05": 0.803333,
"recall-0.1": 0.938333,
"recall-0.15": 0.956667,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"elbow_right": {
"count": 600,
"mean": 0.043215,
"median": 0.033002,
"std": 0.033552,
"sem": 0.001371,
"min": 0.005329,
"max": 0.197639,
"recall-0.025": 0.238333,
"recall-0.05": 0.788333,
"recall-0.1": 0.936667,
"recall-0.15": 0.951667,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"wrist_left": {
"count": 600,
"mean": 0.04324,
"median": 0.024703,
"std": 0.045393,
"sem": 0.001855,
"min": 0.001606,
"max": 0.247877,
"recall-0.025": 0.508333,
"recall-0.05": 0.733333,
"recall-0.1": 0.885,
"recall-0.15": 0.935,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"wrist_right": {
"count": 600,
"mean": 0.047057,
"median": 0.027193,
"std": 0.0531,
"sem": 0.00217,
"min": 0.002414,
"max": 0.477327,
"recall-0.025": 0.441667,
"recall-0.05": 0.75,
"recall-0.1": 0.875,
"recall-0.15": 0.906667,
"recall-0.25": 0.993333,
"recall-0.5": 1.0,
"num_labels": 600
},
"hip_left": {
"count": 600,
"mean": 0.090492,
"median": 0.085867,
"std": 0.033007,
"sem": 0.001349,
"min": 0.009756,
"max": 0.236952,
"recall-0.025": 0.008333,
"recall-0.05": 0.03,
"recall-0.1": 0.813333,
"recall-0.15": 0.95,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"hip_right": {
"count": 600,
"mean": 0.113777,
"median": 0.112926,
"std": 0.026939,
"sem": 0.001101,
"min": 0.035267,
"max": 0.233528,
"recall-0.025": 0.0,
"recall-0.05": 0.01,
"recall-0.1": 0.226667,
"recall-0.15": 0.945,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"knee_left": {
"count": 600,
"mean": 0.061948,
"median": 0.045988,
"std": 0.058304,
"sem": 0.002382,
"min": 0.01465,
"max": 0.398223,
"recall-0.025": 0.036667,
"recall-0.05": 0.581667,
"recall-0.1": 0.9,
"recall-0.15": 0.925,
"recall-0.25": 0.981667,
"recall-0.5": 1.0,
"num_labels": 600
},
"knee_right": {
"count": 600,
"mean": 0.052399,
"median": 0.043783,
"std": 0.037008,
"sem": 0.001512,
"min": 0.014119,
"max": 0.23986,
"recall-0.025": 0.04,
"recall-0.05": 0.725,
"recall-0.1": 0.936667,
"recall-0.15": 0.94,
"recall-0.25": 1.0,
"recall-0.5": 1.0,
"num_labels": 600
},
"ankle_left": {
"count": 598,
"mean": 0.096902,
"median": 0.084781,
"std": 0.05173,
"sem": 0.002117,
"min": 0.044418,
"max": 0.499384,
"recall-0.025": 0.0,
"recall-0.05": 0.003333,
"recall-0.1": 0.84,
"recall-0.15": 0.94,
"recall-0.25": 0.98,
"recall-0.5": 0.996667,
"num_labels": 600
},
"ankle_right": {
"count": 598,
"mean": 0.080563,
"median": 0.06808,
"std": 0.043343,
"sem": 0.001774,
"min": 0.031041,
"max": 0.379768,
"recall-0.025": 0.0,
"recall-0.05": 0.023333,
"recall-0.1": 0.893333,
"recall-0.15": 0.915,
"recall-0.25": 0.983333,
"recall-0.5": 0.996667,
"num_labels": 600
},
"joint_recalls": {
"num_labels": 7800,
"recall-0.025": 0.17295,
"recall-0.05": 0.46744,
"recall-0.1": 0.81782,
"recall-0.15": 0.93013,
"recall-0.25": 0.99372,
"recall-0.5": 0.99949
}
}
{
"total_parts": 8400,
"correct_parts": 8095,
"pcp": 0.96369
}
```

View File

@ -1,4 +1,4 @@
FROM dustynv/l4t-pytorch:r36.4.0
FROM dustynv/onnxruntime:1.20-r36.4.0
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
@ -7,32 +7,17 @@ WORKDIR /
RUN apt-get update && apt-get install -y --no-install-recommends feh
RUN apt-get update && apt-get install -y --no-install-recommends python3-opencv
RUN apt-get update && apt-get install -y --no-install-recommends libatlas-base-dev
# Show matplotlib images
RUN apt-get update && apt-get install -y --no-install-recommends python3-tk
# Install MMPose
ENV FORCE_CUDA="1"
ENV MMCV_WITH_OPS=1
RUN pip3 install --upgrade --no-cache-dir openmim
RUN mim install mmengine
RUN mim install "mmcv>=2,<2.2.0"
RUN mim install "mmdet>=3"
RUN mim install "mmpose>=1.1.0"
# Fix an error when importing mmpose
RUN pip3 install --upgrade --no-cache-dir "numpy<2" scipy
RUN git clone --depth=1 --branch=main https://github.com/open-mmlab/mmpose.git
# Download pretrained model
COPY scripts/utils_2d_pose.py /
RUN python3 -c "from utils_2d_pose import load_model; load_model();"
RUN python3 -c "from utils_2d_pose import load_wb_model; load_wb_model();"
# Install swig and later dependencies
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
RUN apt-get update && apt-get install -y --no-install-recommends swig
RUN apt-get update && apt-get install -y --no-install-recommends libopencv-dev
RUN pip3 install --no-cache-dir scipy
COPY ./skelda/ /skelda/
RUN pip3 install --no-cache-dir -e /skelda/