Home

Awesome

Neural Interactive Keypoint Detection

This is the official pytorch implementation of our ICCV 2023 paper "Neural Interactive Keypoint Detection."

Jie Yang, Ailing Zeng, Feng Li, Shilong Liu, Ruimao Zhang, Lei Zhang

Keywords: πŸ‘― Multi-person 2D pose estimation, πŸ’ƒ Human-in-the-loop, 🀝Interactive model

❀️ Highlights

<img src="assets/dds_kpt.gif" />

πŸ’™ Click-Pose

πŸš€ Model Zoo

1. Model-Only Results

COCO val2017 set

ModelBackboneLr schdmAPAP<sup>50</sup>AP<sup>75</sup>AP<sup>M</sup>AP<sup>L</sup>Time (ms)Model
ED-PoseResNet-5060e71.789.778.866.279.751GitHub, Model
Click-PoseResNet-5040e73.090.480.068.180.548Google Drive

Human-Art val set

ModelBackbonemAPAP<sup>M</sup>AP<sup>L</sup>Model
ED-PoseResNet-5037.57.641.1GitHub, Model
Click-PoseResNet-5040.58.344.2Google Drive

OCHuman test set

ModelBackbonemAPAP<sup>50</sup>AP<sup>75</sup>Model
ED-PoseResNet-5031.439.535.1GitHub, Model
Click-PoseResNet-5033.943.437.5Google Drive

Note that the model is trained on COCO train2017 set and tested on COCO val2017 set, Human-Art val set, and OCHuman test set.

2. Neural Interactive Results

In-domain Annotation (COCO val2017)

ModelBackboneNoC@85NoC@90NoC@95Model
ViTPoseViT-Huge1.462.152.87GitHub, Model
Click-PoseResNet-500.951.481.97Google Drive

Out-of-domain Annotation (Human-Art val)

ModelBackboneNoC@85NoC@90NoC@95Model
ViTPoseViT-Huge9.129.7910.13GitHub, Model
Click-PoseResNet-504.825.816.45Google Drive

πŸ”¨ Environment Setup

<details> <summary>Installation</summary>

We use the ED-Pose as our codebase. We test our models under python=3.7.3,pytorch=1.9.0,cuda=11.1. Other versions might be available as well.

  1. Clone this repo
git clone https://github.com/IDEA-Research/Click-Pose.git
cd Click-Pose
  1. Install Pytorch and torchvision

Follow the instruction on https://pytorch.org/get-started/locally/.

# an example:
conda install -c pytorch pytorch torchvision
  1. Install other needed packages
pip install -r requirements.txt
  1. Compiling CUDA operators
cd models/clickpose/ops
python setup.py build install
# unit test (should see all checking is True)
python test.py
cd ../../..
</details> <details> <summary>Data Preparation</summary>

For COCO data, please download from COCO download. The coco_dir should look like this:

|-- Click-Pose
`-- |-- coco_dir
    `-- |-- annotations
        |   |-- person_keypoints_train2017.json
        |   `-- person_keypoints_val2017.json
        `-- images
            |-- train2017
            |   |-- 000000000009.jpg
            |   |-- 000000000025.jpg
            |   |-- 000000000030.jpg
            |   |-- ... 
            `-- val2017
                |-- 000000000139.jpg
                |-- 000000000285.jpg
                |-- 000000000632.jpg
                |-- ... 

For Human-Art data, please download from Human-Art download, The humanart_dir should look like this:

|-- Click-Pose
`-- |-- humanart_dir
    `-- |-- annotations 
        |   |-- training_humanart.json
        |   |-- validation_humanart.json
        `-- images
            |-- 2D_virtual_human
                |-- ...
            |-- 3D_virtual_human
                |-- ...
            |-- real_human
                |-- ...

For CrowdPose data, please download from CrowdPose download, The crowdpose_dir should look like this:

|-- Click-Pose
`-- |-- crowdpose_dir
    `-- |-- json
        |   |-- crowdpose_train.json
        |   |-- crowdpose_val.json
        |   |-- crowdpose_trainval.json (generated by util/crowdpose_concat_train_val.py)
        |   `-- crowdpose_test.json
        `-- images
            |-- 100000.jpg
            |-- 100001.jpg
            |-- 100002.jpg
            |-- 100003.jpg
            |-- 100004.jpg
            |-- 100005.jpg
            |-- ... 

For OCHuman data, please download from OCHuman download. The ochuman_dir should look like this:

|-- Click-Pose
`-- |-- ochuman_dir
    `-- |-- annotations
        `-- images
</details>

πŸ₯³ Run

Train on COCO:

<details> <summary>Model-Only</summary>
export CLICKPOSE_COCO_PATH=/path/to/your/coco_dir
 python -m torch.distributed.launch --nproc_per_node=4 main.py \
    --output_dir "logs/ClickPose_Model-Only" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=FLASE feedback_loop_NOC_test=FALSE feedback_inference=FALSE only_correction=FALSE \
    --dataset_file="coco" 
</details> <details> <summary>Neural Interactive</summary>
export CLICKPOSE_COCO_PATH=/path/to/your/coco_dir
 python -m torch.distributed.launch --nproc_per_node=4 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=FALSE feedback_inference=FALSE only_correction=FALSE \
    --dataset_file="coco"
</details>

Evaluation on COCO:

<details> <summary>Model-Only</summary>
export CLICKPOSE_COCO_PATH=/path/to/your/coco_dir
 python -m torch.distributed.launch --nproc_per_node=4 main.py \
    --output_dir "logs/ClickPose_Model-Only_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=FLASE feedback_loop_NOC_test=FALSE feedback_inference=FALSE only_correction=FALSE \
    --dataset_file="coco" \
    --pretrain_model_path "./models/ClickPose_model_only_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-NoC metric</summary>
export CLICKPOSE_COCO_PATH=/path/to/your/coco_dir
export CLICKPOSE_NoC_Test="TRUE"
export CLICKPOSE_SAVE_PATH = "./NoC_95_coco.json"
export NoC_thr = 0.95
    python -m torch.distributed.launch --nproc_per_node=1 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=1 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=TRUE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="coco" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-AP metric</summary>
export CLICKPOSE_COCO_PATH=/path/to/your/coco_dir
export CLICKPOSE_NoC_Test="TRUE"
for CLICKPOSE_Click_Number in {1..17}
do
    python -m torch.distributed.launch --nproc_per_node=4 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=FALSE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="coco" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
done


</details>

Evaluation on Human-Art:

<details> <summary>Model-Only</summary>
export CLICKPOSE_HumanArt_PATH=/path/to/your/humanart_dir
 python -m torch.distributed.launch --nproc_per_node=4 main.py \
    --output_dir "logs/ClickPose_Model-Only_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=FLASE feedback_loop_NOC_test=FALSE feedback_inference=FALSE only_correction=FALSE \
    --dataset_file="humanart" \
    --pretrain_model_path "./models/ClickPose_model_only_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-NoC metric</summary>
export CLICKPOSE_HumanArt_PATH=/path/to/your/humanart_dir
export CLICKPOSE_NoC_Test="TRUE"
export CLICKPOSE_SAVE_PATH = "./NoC_95_humanart.json"
export NoC_thr = 0.95
    python -m torch.distributed.launch --nproc_per_node=1 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=1 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=TRUE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="humanart" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-AP metric</summary>
export CLICKPOSE_HumanArt_PATH=/path/to/your/humanart_dir
export CLICKPOSE_NoC_Test="TRUE"
for CLICKPOSE_Click_Number in {1..17}
do
    python -m torch.distributed.launch --nproc_per_node=4 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=FALSE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="humanart" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
done


</details>

Evaluation on OCHuman:

<details> <summary>Model-Only</summary>
export CLICKPOSE_OCHuman_PATH=/path/to/your/ochuman_dir
 python -m torch.distributed.launch --nproc_per_node=4 main.py \
    --output_dir "logs/ClickPose_Model-Only_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=FLASE feedback_loop_NOC_test=FALSE feedback_inference=FALSE only_correction=FALSE \
    --dataset_file="ochuman" \
    --pretrain_model_path "./models/ClickPose_model_only_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-NoC metric</summary>
export CLICKPOSE_OCHuman_PATH=/path/to/your/ochuman_dir
export CLICKPOSE_NoC_Test = "TRUE"
export CLICKPOSE_SAVE_PATH = "./NoC_95_ochuman.json"
export NoC_thr = 0.95
    python -m torch.distributed.launch --nproc_per_node=1 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=1 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=TRUE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="ochuman" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
</details> <details> <summary>Neural Interactive-AP metric</summary>
export CLICKPOSE_OCHuman_PATH=/path/to/your/ochuman_dir
export CLICKPOSE_NoC_Test="TRUE"
for CLICKPOSE_Click_Number in {1..17}
do
    python -m torch.distributed.launch --nproc_per_node=4 --master_port 3458 main.py \
    --output_dir "logs/ClickPose_Neural_Interactive_eval" \
    -c config/clickpose.cfg.py \
    --options batch_size=4 epochs=100 lr_drop=80 use_ema=TRUE human_feedback=TRUE feedback_loop_NOC_test=FALSE feedback_inference=TRUE only_correction=FALSE num_select=20 \
    --dataset_file="ochuman" \
    --pretrain_model_path "./models/ClickPose_interactive_R50.pth" \
    --eval
done


</details>

Cite Click-Pose

If you find this repository useful for your work, please consider citing it as follows:

@inproceedings{yang2023neural,
  title={Neural Interactive Keypoint Detection},
  author={Yang, Jie and Zeng, Ailing and Li, Feng and Liu, Shilong and Zhang, Ruimao and Zhang, Lei},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={15122--15132},
  year={2023}
}
@inproceedings{yang2022explicit,
  title={Explicit Box Detection Unifies End-to-End Multi-Person Pose Estimation},
  author={Yang, Jie and Zeng, Ailing and Liu, Shilong and Li, Feng and Zhang, Ruimao and Zhang, Lei},
  booktitle={The Eleventh International Conference on Learning Representations},
  year={2022}
}