Initial snapshot: hand motion pipeline (Dyn-HaMR + dex-retargeting + SPIDER)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
## 2D Animal Pose Demo
|
||||
|
||||
### 2D Animal Pose Image Demo
|
||||
|
||||
#### Using gt hand bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
*Pose Model Preparation:*
|
||||
The pre-trained pose estimation model can be downloaded from [model zoo](https://mmpose.readthedocs.io/en/latest/topics/animal.html).
|
||||
Take [macaque model](https://download.openmmlab.com/mmpose/animal/resnet/res50_macaque_256x192-98f1dd3a_20210407.pth) as an example:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --json-file ${JSON_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/macaque/res50_macaque_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/animal/resnet/res50_macaque_256x192-98f1dd3a_20210407.pth \
|
||||
--img-root tests/data/macaque/ --json-file tests/data/macaque/test_macaque.json \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
To run demos on CPU:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/macaque/res50_macaque_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/animal/resnet/res50_macaque_256x192-98f1dd3a_20210407.pth \
|
||||
--img-root tests/data/macaque/ --json-file tests/data/macaque/test_macaque.json \
|
||||
--out-img-root vis_results \
|
||||
--device=cpu
|
||||
```
|
||||
|
||||
### 2D Animal Pose Video Demo
|
||||
|
||||
We also provide video demos to illustrate the results.
|
||||
|
||||
#### Using the full image as input
|
||||
|
||||
If the video is cropped with the object centered in the screen, we can simply use the full image as the model input (without object detection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_full_frame_without_det.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_full_frame_without_det.py \
|
||||
configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/fly/res152_fly_192x192.py \
|
||||
https://download.openmmlab.com/mmpose/animal/resnet/res152_fly_192x192-fcafbd5a_20210407.pth \
|
||||
--video-path demo/resources/<demo_fly_video.avi> \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/114023530-944c8280-98a5-11eb-86b0-5f6d3e232af0.gif" height="140px" alt><br>
|
||||
|
||||
#### Using MMDetection to detect animals
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
**COCO-animals**
|
||||
|
||||
In COCO dataset, there are 80 object categories, including 10 common `animal` categories (15: 'bird', 16: 'cat', 17: 'dog', 18: 'horse', 19: 'sheep', 20: 'cow', 21: 'elephant', 22: 'bear', 23: 'zebra', 24: 'giraffe')
|
||||
For these COCO-animals, please download the COCO pre-trained detection model from [MMDetection Model Zoo](https://mmdetection.readthedocs.io/en/latest/model_zoo.html).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
--det-cat-id ${CATEGORY_ID}
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth \
|
||||
configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/horse10/res50_horse10_256x256-split1.py \
|
||||
https://download.openmmlab.com/mmpose/animal/resnet/res50_horse10_256x256_split1-3a3dc37e_20210405.pth \
|
||||
--video-path demo/resources/<demo_horse.mp4> \
|
||||
--out-video-root vis_results \
|
||||
--bbox-thr 0.1 \
|
||||
--kpt-thr 0.4 \
|
||||
--det-cat-id 18
|
||||
```
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/114201893-4446ec00-9989-11eb-808b-5718c47c7b23.gif" height="140px" alt><br>
|
||||
|
||||
**Other Animals**
|
||||
|
||||
For other animals, we have also provided some pre-trained animal detection models (1-class models). Supported models can be found in [det model zoo](/demo/docs/mmdet_modelzoo.md).
|
||||
The pre-trained animal pose estimation model can be found in [pose model zoo](https://mmpose.readthedocs.io/en/latest/topics/animal.html).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--det-cat-id ${CATEGORY_ID}]
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/cascade_rcnn_x101_64x4d_fpn_1class.py \
|
||||
https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_macaque-e45e36f5_20210409.pth \
|
||||
configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/macaque/res152_macaque_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/animal/resnet/res152_macaque_256x192-c42abc02_20210407.pth \
|
||||
--video-path demo/resources/<demo_macaque.mp4> \
|
||||
--out-video-root vis_results \
|
||||
--bbox-thr 0.5 \
|
||||
--kpt-thr 0.3 \
|
||||
```
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/114205282-b5d46980-998c-11eb-9d6b-85ba47f81252.gif" height="140px" alt><br>
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For 2D animal pose estimation models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [macaque-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/animal/resnet/macaque/res50_macaque_256x192.py#L51).
|
||||
1. set `post_process='default'` in [macaque-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/animal/resnet/macaque/res50_macaque_256x192.py#L52).
|
||||
@@ -0,0 +1,103 @@
|
||||
## 2D Face Keypoint Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/109144943-ccd44900-779c-11eb-9e9d-8682e7629654.gif" width="600px" alt><br>
|
||||
|
||||
### 2D Face Image Demo
|
||||
|
||||
#### Using gt face bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
*Face Keypoint Model Preparation:*
|
||||
The pre-trained face keypoint estimation model can be found from [model zoo](https://mmpose.readthedocs.io/en/latest/topics/face.html).
|
||||
Take [aflw model](https://download.openmmlab.com/mmpose/face/hrnetv2/hrnetv2_w18_aflw_256x256-f2bbc62b_20210125.pth) as an example:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --json-file ${JSON_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/face/2d_kpt_sview_rgb_img/topdown_heatmap/aflw/hrnetv2_w18_aflw_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/face/hrnetv2/hrnetv2_w18_aflw_256x256-f2bbc62b_20210125.pth \
|
||||
--img-root tests/data/aflw/ --json-file tests/data/aflw/test_aflw.json \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
To run demos on CPU:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/face/2d_kpt_sview_rgb_img/topdown_heatmap/aflw/hrnetv2_w18_aflw_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/face/hrnetv2/hrnetv2_w18_aflw_256x256-f2bbc62b_20210125.pth \
|
||||
--img-root tests/data/aflw/ --json-file tests/data/aflw/test_aflw.json \
|
||||
--out-img-root vis_results \
|
||||
--device=cpu
|
||||
```
|
||||
|
||||
#### Using face bounding box detectors
|
||||
|
||||
We provide a demo script to run face detection and face keypoint estimation.
|
||||
|
||||
Please install `face_recognition` before running the demo, by `pip install face_recognition`.
|
||||
For more details, please refer to https://github.com/ageitgey/face_recognition.
|
||||
|
||||
```shell
|
||||
python demo/face_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --img ${IMG_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
```shell
|
||||
python demo/face_img_demo.py \
|
||||
configs/face/2d_kpt_sview_rgb_img/topdown_heatmap/aflw/hrnetv2_w18_aflw_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/face/hrnetv2/hrnetv2_w18_aflw_256x256-f2bbc62b_20210125.pth \
|
||||
--img-root tests/data/aflw/ \
|
||||
--img image04476.jpg \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
### 2D Face Video Demo
|
||||
|
||||
We also provide a video demo to illustrate the results.
|
||||
|
||||
Please install `face_recognition` before running the demo, by `pip install face_recognition`.
|
||||
For more details, please refer to https://github.com/ageitgey/face_recognition.
|
||||
|
||||
```shell
|
||||
python demo/face_video_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/face_video_demo.py \
|
||||
configs/face/2d_kpt_sview_rgb_img/topdown_heatmap/aflw/hrnetv2_w18_aflw_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/face/hrnetv2/hrnetv2_w18_aflw_256x256-f2bbc62b_20210125.pth \
|
||||
--video-path https://user-images.githubusercontent.com/87690686/137441355-ec4da09c-3a8f-421b-bee9-b8b26f8c2dd0.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For 2D face keypoint estimation models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [face-hrnetv2_w18](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/face/hrnetv2/aflw/hrnetv2_w18_aflw_256x256.py#L83).
|
||||
1. set `post_process='default'` in [face-hrnetv2_w18](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/face/hrnetv2/aflw/hrnetv2_w18_aflw_256x256.py#L84).
|
||||
@@ -0,0 +1,113 @@
|
||||
## 2D Hand Keypoint Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/109098558-8c54db00-775c-11eb-8966-85df96b23dc5.gif" width="600px" alt><br>
|
||||
|
||||
### 2D Hand Image Demo
|
||||
|
||||
#### Using gt hand bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
*Hand Pose Model Preparation:*
|
||||
The pre-trained hand pose estimation model can be downloaded from [model zoo](https://mmpose.readthedocs.io/en/latest/topics/hand%282d%29.html).
|
||||
Take [onehand10k model](https://download.openmmlab.com/mmpose/top_down/resnet/res50_onehand10k_256x256-e67998f6_20200813.pth) as an example:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --json-file ${JSON_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/hand/2d_kpt_sview_rgb_img/topdown_heatmap/onehand10k/res50_onehand10k_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_onehand10k_256x256-e67998f6_20200813.pth \
|
||||
--img-root tests/data/onehand10k/ --json-file tests/data/onehand10k/test_onehand10k.json \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
To run demos on CPU:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/hand/2d_kpt_sview_rgb_img/topdown_heatmap/onehand10k/res50_onehand10k_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_onehand10k_256x256-e67998f6_20200813.pth \
|
||||
--img-root tests/data/onehand10k/ --json-file tests/data/onehand10k/test_onehand10k.json \
|
||||
--out-img-root vis_results \
|
||||
--device=cpu
|
||||
```
|
||||
|
||||
#### Using mmdet for hand bounding box detection
|
||||
|
||||
We provide a demo script to run mmdet for hand detection, and mmpose for hand pose estimation.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
*Hand Box Model Preparation:* The pre-trained hand box estimation model can be found in [det model zoo](/demo/docs/mmdet_modelzoo.md).
|
||||
|
||||
*Hand Pose Model Preparation:* The pre-trained hand pose estimation model can be downloaded from [pose model zoo](https://mmpose.readthedocs.io/en/latest/topics/hand%282d%29.html).
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --img ${IMG_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py demo/mmdetection_cfg/cascade_rcnn_x101_64x4d_fpn_1class.py \
|
||||
https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_onehand10k-dac19597_20201030.pth \
|
||||
configs/hand/2d_kpt_sview_rgb_img/topdown_heatmap/onehand10k/res50_onehand10k_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_onehand10k_256x256-e67998f6_20200813.pth \
|
||||
--img-root tests/data/onehand10k/ \
|
||||
--img 9.jpg \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
### 2D Hand Video Demo
|
||||
|
||||
We also provide a video demo to illustrate the results.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
*Hand Box Model Preparation:* The pre-trained hand box estimation model can be found in [det model zoo](/demo/docs/mmdet_modelzoo.md).
|
||||
|
||||
*Hand Pose Model Preparation:* The pre-trained hand pose estimation model can be found in [pose model zoo](https://mmpose.readthedocs.io/en/latest/topics/hand%282d%29.html).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py demo/mmdetection_cfg/cascade_rcnn_x101_64x4d_fpn_1class.py \
|
||||
https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_onehand10k-dac19597_20201030.pth \
|
||||
configs/hand/2d_kpt_sview_rgb_img/topdown_heatmap/onehand10k/res50_onehand10k_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_onehand10k_256x256-e67998f6_20200813.pth \
|
||||
--video-path https://user-images.githubusercontent.com/87690686/137441388-3ea93d26-5445-4184-829e-bf7011def9e4.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For 2D hand pose estimation models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [hand-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/hand/resnet/onehand10k/res50_onehand10k_256x256.py#L56).
|
||||
1. set `post_process='default'` in [hand-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/hand/resnet/onehand10k/res50_onehand10k_256x256.py#L57).
|
||||
@@ -0,0 +1,159 @@
|
||||
## 2D Human Pose Demo
|
||||
|
||||
<img src="https://raw.githubusercontent.com/open-mmlab/mmpose/master/demo/resources/demo_coco.gif" width="600px" alt><br>
|
||||
|
||||
### 2D Human Pose Top-Down Image Demo
|
||||
|
||||
#### Using gt human bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --json-file ${JSON_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
|
||||
--img-root tests/data/coco/ --json-file tests/data/coco/test_coco.json \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
To run demos on CPU:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
|
||||
--img-root tests/data/coco/ --json-file tests/data/coco/test_coco.json \
|
||||
--out-img-root vis_results \
|
||||
--device=cpu
|
||||
```
|
||||
|
||||
#### Using mmdet for human bounding box detection
|
||||
|
||||
We provide a demo script to run mmdet for human detection, and mmpose for pose estimation.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --img ${IMG_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
|
||||
--img-root tests/data/coco/ \
|
||||
--img 000000196141.jpg \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
### 2D Human Pose Top-Down Video Demo
|
||||
|
||||
We also provide a video demo to illustrate the results.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
|
||||
--video-path demo/resources/demo.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### 2D Human Pose Bottom-Up Image Demo
|
||||
|
||||
We provide a demo script to test a single image.
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-path ${IMG_PATH}\
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR} --pose-nms-thr ${POSE_NMS_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_img_demo.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/associative_embedding/coco/hrnet_w32_coco_512x512.py \
|
||||
https://download.openmmlab.com/mmpose/bottom_up/hrnet_w32_coco_512x512-bcb8c247_20200816.pth \
|
||||
--img-path tests/data/coco/ \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
### 2D Human Pose Bottom-Up Video Demo
|
||||
|
||||
We also provide a video demo to illustrate the results.
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_video_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR} --pose-nms-thr ${POSE_NMS_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_video_demo.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/associative_embedding/coco/hrnet_w32_coco_512x512.py \
|
||||
https://download.openmmlab.com/mmpose/bottom_up/hrnet_w32_coco_512x512-bcb8c247_20200816.pth \
|
||||
--video-path demo/resources/demo.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For top-down models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [topdown-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/top_down/resnet/coco/res50_coco_256x192.py#L51).
|
||||
1. set `post_process='default'` in [topdown-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/top_down/resnet/coco/res50_coco_256x192.py#L52).
|
||||
1. use faster human bounding box detector, see [MMDetection](https://mmdetection.readthedocs.io/en/latest/model_zoo.html).
|
||||
|
||||
For bottom-up models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L80).
|
||||
1. set `adjust=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L78).
|
||||
1. set `refine=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L79).
|
||||
1. use smaller input image size in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L39).
|
||||
@@ -0,0 +1,101 @@
|
||||
## 2D Pose Tracking Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/11788150/109099201-a93dde00-775d-11eb-9624-f9676fc0e478.gif" width="600px" alt><br>
|
||||
|
||||
### 2D Top-Down Video Human Pose Tracking Demo
|
||||
|
||||
We provide a video demo to illustrate the pose tracking results.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_pose_tracking_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
[--use-oks-tracking --tracking-thr ${TRACKING_THR} --euro]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_pose_tracking_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/res50_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_coco_256x192-ec54d7f3_20200709.pth \
|
||||
--video-path demo/resources/demo.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### 2D Top-Down Video Human Pose Tracking Demo with MMTracking
|
||||
|
||||
MMTracking is an open source video perception toolbox based on PyTorch for tracking related tasks.
|
||||
Here we show how to utilize MMTracking and MMPose to achieve human pose tracking.
|
||||
|
||||
Assume that you have already installed [mmtracking](https://github.com/open-mmlab/mmtracking).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmtracking.py \
|
||||
${MMTRACKING_CONFIG_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_pose_tracking_demo_with_mmtracking.py \
|
||||
demo/mmtracking_cfg/tracktor_faster-rcnn_r50_fpn_4e_mot17-private.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/res50_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/resnet/res50_coco_256x192-ec54d7f3_20200709.pth \
|
||||
--video-path demo/resources/demo.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### 2D Bottom-Up Video Human Pose Tracking Demo
|
||||
|
||||
We also provide a pose tracking demo with bottom-up pose estimation methods.
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_pose_tracking_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR} --pose-nms-thr ${POSE_NMS_THR}]
|
||||
[--use-oks-tracking --tracking-thr ${TRACKING_THR} --euro]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/bottom_up_pose_tracking_demo.py \
|
||||
configs/body/2d_kpt_sview_rgb_img/associative_embedding/coco/hrnet_w32_coco_512x512.py \
|
||||
https://download.openmmlab.com/mmpose/bottom_up/hrnet_w32_coco_512x512-bcb8c247_20200816.pth \
|
||||
--video-path demo/resources/demo.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For top-down models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [topdown-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/top_down/resnet/coco/res50_coco_256x192.py#L51).
|
||||
1. set `post_process='default'` in [topdown-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/top_down/resnet/coco/res50_coco_256x192.py#L52).
|
||||
1. use faster human detector or human tracker, see [MMDetection](https://mmdetection.readthedocs.io/en/latest/model_zoo.html) or [MMTracking](https://mmtracking.readthedocs.io/en/latest/model_zoo.html).
|
||||
|
||||
For bottom-up models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L80).
|
||||
1. set `adjust=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L78).
|
||||
1. set `refine=False` in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L79).
|
||||
1. use smaller input image size in [AE-res50](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/bottom_up/resnet/coco/res50_coco_512x512.py#L39).
|
||||
@@ -0,0 +1,106 @@
|
||||
## 2D Human Whole-Body Pose Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/9464825/95552839-00a61080-0a40-11eb-818c-b8dad7307217.gif" width="600px" alt><br>
|
||||
|
||||
### 2D Human Whole-Body Pose Top-Down Image Demo
|
||||
|
||||
#### Using gt human bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --json-file ${JSON_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/wholebody/2d_kpt_sview_rgb_img/topdown_heatmap/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_wholebody_384x288_dark-f5726563_20200918.pth \
|
||||
--img-root tests/data/coco/ --json-file tests/data/coco/test_coco.json \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
To run demos on CPU:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo.py \
|
||||
configs/wholebody/2d_kpt_sview_rgb_img/topdown_heatmap/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_wholebody_384x288_dark-f5726563_20200918.pth \
|
||||
--img-root tests/data/coco/ --json-file tests/data/coco/test_coco.json \
|
||||
--out-img-root vis_results \
|
||||
--device=cpu
|
||||
```
|
||||
|
||||
#### Using mmdet for human bounding box detection
|
||||
|
||||
We provide a demo script to run mmdet for human detection, and mmpose for pose estimation.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--img-root ${IMG_ROOT} --img ${IMG_FILE} \
|
||||
--out-img-root ${OUTPUT_DIR} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_img_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/wholebody/2d_kpt_sview_rgb_img/topdown_heatmap/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_wholebody_384x288_dark-f5726563_20200918.pth \
|
||||
--img-root tests/data/coco/ \
|
||||
--img 000000196141.jpg \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
|
||||
### 2D Human Whole-Body Pose Top-Down Video Demo
|
||||
|
||||
We also provide a video demo to illustrate the results.
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
${MMDET_CONFIG_FILE} ${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--video-path ${VIDEO_FILE} \
|
||||
--out-video-root ${OUTPUT_VIDEO_ROOT} \
|
||||
[--show --device ${GPU_ID or CPU}] \
|
||||
[--bbox-thr ${BBOX_SCORE_THR} --kpt-thr ${KPT_SCORE_THR}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
|
||||
```shell
|
||||
python demo/top_down_video_demo_with_mmdet.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/wholebody/2d_kpt_sview_rgb_img/topdown_heatmap/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_wholebody_384x288_dark-f5726563_20200918.pth \
|
||||
--video-path https://user-images.githubusercontent.com/87690686/137440639-fb08603d-9a35-474e-b65f-46b5c06b68d6.mp4 \
|
||||
--out-video-root vis_results
|
||||
```
|
||||
|
||||
### Speed Up Inference
|
||||
|
||||
Some tips to speed up MMPose inference:
|
||||
|
||||
For top-down models, try to edit the config file. For example,
|
||||
|
||||
1. set `flip_test=False` in [pose_hrnet_w48_dark+](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/wholebody/darkpose/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py#L80).
|
||||
1. set `post_process='default'` in [pose_hrnet_w48_dark+](https://github.com/open-mmlab/mmpose/tree/e1ec589884235bee875c89102170439a991f8450/configs/wholebody/darkpose/coco-wholebody/hrnet_w48_coco_wholebody_384x288_dark_plus.py#L81).
|
||||
1. use faster human bounding box detector, see [MMDetection](https://mmdetection.readthedocs.io/en/latest/model_zoo.html).
|
||||
@@ -0,0 +1,28 @@
|
||||
## 3D Mesh Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/28900607/124615414-d33fa380-dea7-11eb-9ec4-a01d0931e028.gif" width="600px" alt><br>
|
||||
|
||||
### 3D Mesh Recovery Demo
|
||||
|
||||
We provide a demo script to recover human 3D mesh from a single image.
|
||||
|
||||
```shell
|
||||
python demo/mesh_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--json-file ${JSON_FILE} \
|
||||
--img-root ${IMG_ROOT} \
|
||||
[--show] \
|
||||
[--device ${GPU_ID or CPU}] \
|
||||
[--out-img-root ${OUTPUT_DIR}]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```shell
|
||||
python demo/mesh_img_demo.py \
|
||||
configs/body/3d_mesh_sview_rgb_img/hmr/mixed/res50_mixed_224x224.py \
|
||||
https://download.openmmlab.com/mmpose/mesh/hmr/hmr_mesh_224x224-c21e8229_20201015.pth \
|
||||
--json-file tests/data/h36m/h36m_coco.json \
|
||||
--img-root tests/data/h36m \
|
||||
--out-img-root vis_results
|
||||
```
|
||||
@@ -0,0 +1,50 @@
|
||||
## 3D Hand Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/28900607/121288285-b8fcbf00-c915-11eb-98e4-ba846de12987.gif" width="600px" alt><br>
|
||||
|
||||
### 3D Hand Estimation Image Demo
|
||||
|
||||
#### Using gt hand bounding boxes as input
|
||||
|
||||
We provide a demo script to test a single image, given gt json file.
|
||||
|
||||
```shell
|
||||
python demo/interhand3d_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE} ${MMPOSE_CHECKPOINT_FILE} \
|
||||
--json-file ${JSON_FILE} \
|
||||
--img-root ${IMG_ROOT} \
|
||||
[--camera-param-file ${CAMERA_PARAM_FILE}] \
|
||||
[--gt-joints-file ${GT_JOINTS_FILE}]\
|
||||
[--show] \
|
||||
[--device ${GPU_ID or CPU}] \
|
||||
[--out-img-root ${OUTPUT_DIR}] \
|
||||
[--rebase-keypoint-height] \
|
||||
[--show-ground-truth]
|
||||
```
|
||||
|
||||
Example with gt keypoints and camera parameters:
|
||||
|
||||
```shell
|
||||
python demo/interhand3d_img_demo.py \
|
||||
configs/hand/3d_kpt_sview_rgb_img/internet/interhand3d/res50_interhand3d_all_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/hand3d/internet/res50_intehand3d_all_256x256-b9c1cf4c_20210506.pth \
|
||||
--json-file tests/data/interhand2.6m/test_interhand2.6m_data.json \
|
||||
--img-root tests/data/interhand2.6m \
|
||||
--camera-param-file tests/data/interhand2.6m/test_interhand2.6m_camera.json \
|
||||
--gt-joints-file tests/data/interhand2.6m/test_interhand2.6m_joint_3d.json \
|
||||
--out-img-root vis_results \
|
||||
--rebase-keypoint-height \
|
||||
--show-ground-truth
|
||||
```
|
||||
|
||||
Example without gt keypoints and camera parameters:
|
||||
|
||||
```shell
|
||||
python demo/interhand3d_img_demo.py \
|
||||
configs/hand/3d_kpt_sview_rgb_img/internet/interhand3d/res50_interhand3d_all_256x256.py \
|
||||
https://download.openmmlab.com/mmpose/hand3d/internet/res50_intehand3d_all_256x256-b9c1cf4c_20210506.pth \
|
||||
--json-file tests/data/interhand2.6m/test_interhand2.6m_data.json \
|
||||
--img-root tests/data/interhand2.6m \
|
||||
--out-img-root vis_results \
|
||||
--rebase-keypoint-height
|
||||
```
|
||||
@@ -0,0 +1,84 @@
|
||||
## 3D Human Pose Demo
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/15977946/118820606-02df2000-b8e9-11eb-9984-b9228101e780.gif" width="600px" alt><br>
|
||||
|
||||
### 3D Human Pose Two-stage Estimation Image Demo
|
||||
|
||||
#### Using ground truth 2D poses as the 1st stage (pose detection) result, and inference the 2nd stage (2D-to-3D lifting)
|
||||
|
||||
We provide a demo script to test on single images with a given ground-truth Json file.
|
||||
|
||||
```shell
|
||||
python demo/body3d_two_stage_img_demo.py \
|
||||
${MMPOSE_CONFIG_FILE_3D} \
|
||||
${MMPOSE_CHECKPOINT_FILE_3D} \
|
||||
--json-file ${JSON_FILE} \
|
||||
--img-root ${IMG_ROOT} \
|
||||
--only-second-stage \
|
||||
[--show] \
|
||||
[--device ${GPU_ID or CPU}] \
|
||||
[--out-img-root ${OUTPUT_DIR}] \
|
||||
[--rebase-keypoint-height] \
|
||||
[--show-ground-truth]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```shell
|
||||
python demo/body3d_two_stage_img_demo.py \
|
||||
configs/body/3d_kpt_sview_rgb_img/pose_lift/h36m/simplebaseline3d_h36m.py \
|
||||
https://download.openmmlab.com/mmpose/body3d/simple_baseline/simple3Dbaseline_h36m-f0ad73a4_20210419.pth \
|
||||
--json-file tests/data/h36m/h36m_coco.json \
|
||||
--img-root tests/data/h36m \
|
||||
--camera-param-file tests/data/h36m/cameras.pkl \
|
||||
--only-second-stage \
|
||||
--out-img-root vis_results \
|
||||
--rebase-keypoint-height \
|
||||
--show-ground-truth
|
||||
```
|
||||
|
||||
### 3D Human Pose Two-stage Estimation Video Demo
|
||||
|
||||
#### Using mmdet for human bounding box detection and top-down model for the 1st stage (2D pose detection), and inference the 2nd stage (2D-to-3D lifting)
|
||||
|
||||
Assume that you have already installed [mmdet](https://github.com/open-mmlab/mmdetection).
|
||||
|
||||
```shell
|
||||
python demo/body3d_two_stage_video_demo.py \
|
||||
${MMDET_CONFIG_FILE} \
|
||||
${MMDET_CHECKPOINT_FILE} \
|
||||
${MMPOSE_CONFIG_FILE_2D} \
|
||||
${MMPOSE_CHECKPOINT_FILE_2D} \
|
||||
${MMPOSE_CONFIG_FILE_3D} \
|
||||
${MMPOSE_CHECKPOINT_FILE_3D} \
|
||||
--video-path ${VIDEO_PATH} \
|
||||
[--rebase-keypoint-height] \
|
||||
[--norm-pose-2d] \
|
||||
[--num-poses-vis NUM_POSES_VIS] \
|
||||
[--show] \
|
||||
[--out-video-root ${OUT_VIDEO_ROOT}] \
|
||||
[--device ${GPU_ID or CPU}] \
|
||||
[--det-cat-id DET_CAT_ID] \
|
||||
[--bbox-thr BBOX_THR] \
|
||||
[--kpt-thr KPT_THR] \
|
||||
[--use-oks-tracking] \
|
||||
[--tracking-thr TRACKING_THR] \
|
||||
[--euro] \
|
||||
[--radius RADIUS] \
|
||||
[--thickness THICKNESS]
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```shell
|
||||
python demo/body3d_two_stage_video_demo.py \
|
||||
demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
|
||||
https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
|
||||
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
|
||||
https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
|
||||
configs/body/3d_kpt_sview_rgb_vid/video_pose_lift/h36m/videopose3d_h36m_243frames_fullconv_supervised_cpn_ft.py \
|
||||
https://download.openmmlab.com/mmpose/body3d/videopose/videopose_h36m_243frames_fullconv_supervised_cpn_ft-88f5abbb_20210527.pth \
|
||||
--video-path demo/resources/<demo_body3d>.mp4 \
|
||||
--out-video-root vis_results \
|
||||
--rebase-keypoint-height
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
## Pre-trained Detection Models
|
||||
|
||||
### Human Bounding Box Detection Models
|
||||
|
||||
For human bounding box detection models, please download from [MMDetection Model Zoo](https://mmdetection.readthedocs.io/en/latest/model_zoo.html).
|
||||
MMDetection provides 80-class COCO-pretrained models, which already includes the `person` category.
|
||||
|
||||
### Hand Bounding Box Detection Models
|
||||
|
||||
For hand bounding box detection, we simply train our hand box models on onehand10k dataset using MMDetection.
|
||||
|
||||
#### Hand detection results on OneHand10K test set
|
||||
|
||||
| Arch | Box AP | ckpt | log |
|
||||
| :-------------- | :-----------: | :------: | :------: |
|
||||
| [Cascade_R-CNN X-101-64x4d-FPN-1class](/demo/mmdetection_cfg/cascade_rcnn_x101_64x4d_fpn_1class.py) | 0.817 | [ckpt](https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_onehand10k-dac19597_20201030.pth) | [log](https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_onehand10k_20201030.log.json) |
|
||||
|
||||
### Animal Bounding Box Detection Models
|
||||
|
||||
#### COCO animals
|
||||
|
||||
In COCO dataset, there are 80 object categories, including 10 common `animal` categories (16: 'bird', 17: 'cat', 18: 'dog', 19: 'horse', 20: 'sheep', 21: 'cow', 22: 'elephant', 23: 'bear', 24: 'zebra', 25: 'giraffe')
|
||||
For animals in the categories, please download from [MMDetection Model Zoo](https://mmdetection.readthedocs.io/en/latest/model_zoo.html).
|
||||
|
||||
#### Macaque detection results on MacaquePose test set
|
||||
|
||||
| Arch | Box AP | ckpt | log |
|
||||
| :-------------- | :-----------: | :------: | :------: |
|
||||
| [Faster_R-CNN_Res50-FPN-1class](/demo/mmdetection_cfg/faster_rcnn_r50_fpn_1class.py) | 0.840 | [ckpt](https://download.openmmlab.com/mmpose/mmdet_pretrained/faster_rcnn_r50_fpn_1x_macaque-f64f2812_20210409.pth) | [log](https://download.openmmlab.com/mmpose/mmdet_pretrained/faster_rcnn_r50_fpn_1x_macaque_20210409.log.json) |
|
||||
| [Cascade_R-CNN X-101-64x4d-FPN-1class](/demo/mmdetection_cfg/cascade_rcnn_x101_64x4d_fpn_1class.py) | 0.879 | [ckpt](https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_macaque-e45e36f5_20210409.pth) | [log](https://download.openmmlab.com/mmpose/mmdet_pretrained/cascade_rcnn_x101_64x4d_fpn_20e_macaque_20210409.log.json) |
|
||||
@@ -0,0 +1,49 @@
|
||||
## Webcam Demo
|
||||
|
||||
We provide a webcam demo tool which integrartes detection and 2D pose estimation for humans and animals. You can simply run the following command:
|
||||
|
||||
```python
|
||||
python demo/webcam_demo.py
|
||||
```
|
||||
|
||||
It will launch a window to display the webcam video steam with detection and pose estimation results:
|
||||
|
||||
<div align="center">
|
||||
<img src="https://user-images.githubusercontent.com/15977946/124059525-ce20c580-da5d-11eb-8e4a-2d96cd31fe9f.gif" width="600px" alt><br>
|
||||
</div>
|
||||
|
||||
### Usage Tips
|
||||
|
||||
- **Which model is used in the demo tool?**
|
||||
|
||||
Please check the following default arguments in the script. You can also choose other models from the [MMDetection Model Zoo](https://github.com/open-mmlab/mmdetection/blob/master/docs/model_zoo.md) and [MMPose Model Zoo](https://mmpose.readthedocs.io/en/latest/modelzoo.html#) or use your own models.
|
||||
|
||||
| Model | Arguments |
|
||||
| :--: | :-- |
|
||||
| Detection | `--det-config`, `--det-checkpoint` |
|
||||
| Human Pose | `--human-pose-config`, `--human-pose-checkpoint` |
|
||||
| Animal Pose | `--animal-pose-config`, `--animal-pose-checkpoint` |
|
||||
|
||||
- **Can this tool run without GPU?**
|
||||
|
||||
Yes, you can set `--device=cpu` and the model inference will be performed on CPU. Of course, this may cause a low inference FPS compared to using GPU devices.
|
||||
|
||||
- **Why there is time delay between the pose visualization and the video?**
|
||||
|
||||
The video I/O and model inference are running asynchronously and the latter usually takes more time for a single frame. To allevidate the time delay, you can:
|
||||
|
||||
1. set `--display-delay=MILLISECONDS` to defer the video stream, according to the inference delay shown at the top left corner. Or,
|
||||
|
||||
2. set `--synchronous-mode` to force video stream being aligned with inference results. This may reduce the video display FPS.
|
||||
|
||||
- **Can this tool process video files?**
|
||||
|
||||
Yes. You can set `--cam-id=VIDEO_FILE_PATH` to run the demo tool in offline mode on a video file. Note that `--synchronous-mode` should be set in this case.
|
||||
|
||||
- **How to enable/disable the special effects?**
|
||||
|
||||
The special effects can be enabled/disabled at launch time by setting arguments like `--bugeye`, `--sunglasses`, *etc*. You can also toggle the effects by keyboard shortcuts like `b`, `s` when the tool starts.
|
||||
|
||||
- **What if my computer doesn't have a camera?**
|
||||
|
||||
You can use a smart phone as a webcam with apps like [Camo](https://reincubate.com/camo/) or [DroidCam](https://www.dev47apps.com/).
|
||||
Reference in New Issue
Block a user