Home

Awesome

PPDM

Code for our CVPR 2020 paper "PPDM: Parallel Point Detection and Matching for Real-time Human-Object Interaction Detection".

Contributed by Yue Liao, Si Liu, Fei Wang, Yanjie Chen, Chen Qian, Jiashi Feng.

Checklist

Getting Started

Installation

The code was tested on Ubuntu 16.04, with Python 3.6 and PyTorch v0.4.1.

  1. Clone this repository.

    git clone https://github.com/YueLiao/PPDM.git $PPDM_ROOT
    
  2. Install pytorch0.4.1.

    conda install pytorch=0.4.1 cudatoolkit=9.0 torchvision -c pytorch
    
  3. Install the requirements.

    pip install -r requirements.txt
    
  4. Compile deformable convolutional (from DCNv2).

    cd $PPDM_ROOT/src/lib/models/networks/DCNv2
    ./make.sh
    

Demo

  1. Image Demo

  2. Video Demo

Training and Test

Dataset Preparation

  1. Download HICO-Det datasets. Organize them in Dataset folder as follows:

    |-- Dataset/
    |   |-- <dataset name>/
    |       |-- images
    |       |-- annotations
    
  2. Download the pre-processed annotations for HICO-Det from the [websit] and replace the original annotations in Dataset folder. The pre-processed annotations including

    |-- anotations/
    |   |-- trainval_hico.json
    |   |-- test_hico.json
    |   |-- corre_hico.npy
    

    The trainval_hico.json and test_hico.json are the "HOI-A format" annotations generated from iCAN annotation. corre_hico.npy is a binary mask, if the ith category of object and the jth category of verb can form an HOI label, the value at location (i, j) of corre_hico.npy is set to 1, else 0.

Training

  1. Download the corresponding pre-trained models trained on COCO object detection dataset provided by CenterNet. (Res18, DLA34, Hourglass104). Put them into the models folder.

  2. The scripts for training in experiments folder. An example traning on HICO-DET dataset as follow:

    cd src
    python main.py  Hoidet --batch_size 112 --master_batch 7 --lr 4.5e-4 --gpus 0,1,2,3,4,5,6,7  --num_workers 16  --load_model ../models/ctdet_coco_dla_2x.pth --image_dir images/train2015 --dataset hico --exp_id hoidet_hico_dla
    

Test

  1. Evalution by our rewritten script and select the best checkpoint. The scripts for evalution are put into experiments folder. An example evalution on HICO-DET dataset as follow:

    cd src
    python test_hoi.py Hoidet --exp_id hoidet_hico_dla --gpus 0 --dataset hico --image_dir images/test2015 --test_with_eval
    

    or directly generating the predictions and evalutating for a certern checkpoint:

    cd src
    python test_hoi.py Hoidet --exp_id hoidet_hico_dla --load_model ../exp/Hoidet/hoidet_hico_dla/model_140.pth --gpus 0 --dataset hico --image_dir images/test2015 --test_with_eval
    
  2. For HICO-DET official evalution.

    The mAPs evaluated by our provided scripts are a bit lower (about 0.5% mAP) than the official evaluation script.

Results on HICO-DET and HOI-A

We donot carefully tune the training hyper-parameters just following the setting in Centernet, e.g., lr, loss_weight, max_epoch, which may not be the best choice for our PPDM. It causes that the last checkpoint may not be the best one. We report two results and provide the corresponding two models for each setting, i.e. last checkpoint (the former, reported in the paper) and the best checkpoint.

Our Results on HICO-DET dataset

ModelFull (def)Rare (def)None-Rare (def)Full (ko)Rare (ko)None-Rare (ko)FPSDownload
res1814.907.6117.0817.319.7919.5589model
dla3419.94/20.0613.01/13.3222.01/22.0822.63/22.7315.93/16.2924.63/24.6538model
dla34_3level20.00/20.1512.56/13.4822.22/22.1522.65/22.9115.02/16.1824.93/24.9137model
dla34_glob19.85/19.8512.99/12.9921.90/21.9022.49/22.4915.86/15.8624.47/24.4738model
dla34_glob_3level20.29/20.4113.06/13.3422.45/22.5223.09/23.1616.14/16.2425.17/25.2337model
hourglass10421.73/21.9413.78/13.9724.10/24.3224.58/24.8116.65/17.0926.84/27.1214model

Our Results on HOI-A dataset

Coming soon.

Citation

Please consider citing this project in your publications if it helps your research. The following is a BibTeX reference. The BibTeX entry requires the url LaTeX package.

@inproceedings{liao2020ppdm,
  title={Ppdm: Parallel point detection and matching for real-time human-object interaction detection},
  author={Liao, Yue and Liu, Si and Wang, Fei and Chen, Yanjie and Qian, Chen and Feng, Jiashi},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={482--490},
  year={2020}
}

@ARTICLE{10496247,
  author={Liao, Yue and Liu, Si and Gao, Yulu and Zhang, Aixi and Li, Zhimin and Wang, Fei and Li, Bo},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={PPDM++: Parallel Point Detection and Matching for Fast and Accurate HOI Detection}, 
  year={2024},
  pages={1-16},
  doi={10.1109/TPAMI.2024.3386891}
}

License

PPDM is released under the MIT license. See LICENSE for additional details.

Acknowledge

Some of the codes are built upon Objects as Points and iCAN. Thank them for their great work!