All Projects → DirtyHarryLYL → Dj Rn

DirtyHarryLYL / Dj Rn

Licence: apache-2.0
As a part of HAKE project (HAKE-3D). Code for our CVPR2020 paper "Detailed 2D-3D Joint Representation for Human-Object Interaction".

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dj Rn

Matterport
Matterport3D is a pretty awesome dataset for RGB-D machine learning tasks :)
Stars: ✭ 583 (+647.44%)
Mutual labels:  3d-reconstruction
Scannet
Stars: ✭ 860 (+1002.56%)
Mutual labels:  3d-reconstruction
Vgg Multiple View Geometry
A set of MATLAB utilities for multiple view geometry, provided alongside Hartley & Zisserman's "Multiple View Geometry in Computer Vision, Second Edition" (2004). Obtained from http://www.robots.ox.ac.uk/~vgg/hzbook/code/.
Stars: ✭ 62 (-20.51%)
Mutual labels:  3d-reconstruction
Softras
Project page of paper "Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning"
Stars: ✭ 715 (+816.67%)
Mutual labels:  3d-reconstruction
Kimera
Index repo for Kimera code
Stars: ✭ 802 (+928.21%)
Mutual labels:  3d-reconstruction
Bundlefusion
[Siggraph 2017] BundleFusion: Real-time Globally Consistent 3D Reconstruction using Online Surface Re-integration
Stars: ✭ 979 (+1155.13%)
Mutual labels:  3d-reconstruction
Mvs Texturing
Algorithm to texture 3D reconstructions from multi-view stereo images
Stars: ✭ 532 (+582.05%)
Mutual labels:  3d-reconstruction
3d Reconstruction With Neural Networks
3D reconstruction with neural networks using Tensorflow. See link for Video (https://www.youtube.com/watch?v=iI6ZMST8Ri0)
Stars: ✭ 71 (-8.97%)
Mutual labels:  3d-reconstruction
Gradslam
gradslam is an open source differentiable dense SLAM library for PyTorch
Stars: ✭ 833 (+967.95%)
Mutual labels:  3d-reconstruction
Floor Sp
Floor-SP: Inverse CAD for Floorplans by Sequential Room-wise Shortest Path, ICCV 2019
Stars: ✭ 54 (-30.77%)
Mutual labels:  3d-reconstruction
Face swap
End-to-end, automatic face swapping pipeline
Stars: ✭ 722 (+825.64%)
Mutual labels:  3d-reconstruction
3d Machine Learning
A resource repository for 3D machine learning
Stars: ✭ 7,405 (+9393.59%)
Mutual labels:  3d-reconstruction
Mirror
Matchable Image Retrieval by Learning from Surface Reconstruction
Stars: ✭ 44 (-43.59%)
Mutual labels:  3d-reconstruction
Teaser Plusplus
A fast and robust point cloud registration library
Stars: ✭ 607 (+678.21%)
Mutual labels:  3d-reconstruction
Py3drec
3D modeling from uncalibrated images
Stars: ✭ 65 (-16.67%)
Mutual labels:  3d-reconstruction
3dv tutorial
An Invitation to 3D Vision: A Tutorial for Everyone
Stars: ✭ 571 (+632.05%)
Mutual labels:  3d-reconstruction
Rgbd rtk
RGB-D Reconstruction Toolkit
Stars: ✭ 27 (-65.38%)
Mutual labels:  3d-reconstruction
Pymeshfix
Python Wrapper for MeshFix: easily repair holes in PyVista surface meshes
Stars: ✭ 75 (-3.85%)
Mutual labels:  3d-reconstruction
Awesome Cryoem
A collaborative list of awesome CryoEM (Cryo Electron Microscopy) resources.
Stars: ✭ 66 (-15.38%)
Mutual labels:  3d-reconstruction
Pifu
This repository contains the code for the paper "PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization"
Stars: ✭ 1,021 (+1208.97%)
Mutual labels:  3d-reconstruction

DJ-RN

As a part of HAKE project (HAKE-3D). Code for our CVPR2020 paper "Detailed 2D-3D Joint Representation for Human-Object Interaction".

News: (2021.2.7) Upgraded HAKE-Activity2Vec is released! Images/Videos --> human box + ID + skeleton + part states + action + representation. [Description]

Full demo: [YouTube], [bilibili]

(2021.1.15) Our extended version of TIN (Transferable Interactiveness Network) is accepted by TPAMI! New paper and code will be released soon.

(2020.10.27) The code of IDN (Paper) in NeurIPS'20 is released!

(2020.6.16) Our larger version HAKE-Large (>120K images, activity and part state labels) is released!

  • Paper is here: arXiv
  • PyTorch version is here (work in progress)
  • Single-view human detailed shape reconstruction, 2D & 3D pose and detailed shape from OpenPose and SMPLify-X.
  • Interacted object 3D location-size recovering as hollow sphere.
  • 2D-3D joint human body part attention.
  • Multi-modal representation for HOI detection.

Ambiguous-HOI

This repo contains the code for the proposed Ambiguous-HOI dataset.

To collect the data set, run

bash script/Generate_Ambiguous_HOI.sh

After running this, the data and code related to Ambiguous-HOI would be organized as:

DJ-RN
├──Data
    ├── Ambiguous_HOI
        └── ...                  # The jpeg image files
    └── Test_ambiguous.pkl       # Person and object boudning boxes used by DJ-RN
└── -Results
    ├── gt_ambiguous_hoi_new.pkl # Annotation file
    └── Evaluate_HICO_DET.py     # Evaluation script

Run python ./-Results/Evaluate_ambiguous.py <your detection file> <path to save the result> to evaluate the performace. The detection file should be a pickle file with format of

{'xxx.jpg': # image file name
    [
        [x1, y1, x2, y2],        # Human bounding box
        [x1, y1, x2, y2],        # Object bounding box
        x,                       # Object category, 1~80
        np.array([xx, ..., xx]), # HOI detection score, np.array with size of (600,)
        x,                       # Human detection confidence
        x,                       # Object detection confidence
    ], 
    ...
}

Results on HICO-DET and Ambiguous-HOI

Our results on HICO-DET dataset, using object detections from iCAN (COCO pre-trained detector)

Method Full(def) Rare(def) None-Rare(def) Full(ko) Rare(ko) None-Rare(ko)
iCAN (BMVC2018) 14.84 10.45 16.15 16.26 11.33 17.73
TIN (CVPR2019) 17.03 13.42 18.11 19.17 15.51 20.26
Analogy (ICCV2019) 19.40 14.60 20.90 - - -
DJ-RN (CVPR2020) 21.34 18.53 22.18 23.69 20.64 24.60

Our results on Ambiguous-HOI

Method mAP
iCAN (BMVC2018) 8.14
TIN (CVPR2019) 8.22
Analogy (ICCV2019, reproduced) 9.72
DJ-RN (CVPR2020) 10.37

Getting Started

Installation

  1. Clone this repository.

  2. Download HICO-DET dataset and detection files. The detection results (person and object boudning boxes) are collected from: iCAN.

bash script/Download_HICO-DET.sh
  1. Generate Ambiguous-HOI dataset.
bash script/Generate_Ambiguous_HOI.sh
  1. Download SMPL-X model referring to this link, and unzip and organize the directory structure as follows:
models
├── smplx
    ├── SMPLX_FEMALE.npz
    ├── SMPLX_FEMALE.pkl
    ├── SMPLX_MALE.npz
    ├── SMPLX_MALE.pkl
    ├── SMPLX_NEUTRAL.npz
    └── SMPLX_NEUTRAL.pkl

models/smplx will be referred to as smplx_path in the following instruction.

  1. Download pretrained weight of our model. (Optional)
bash script/Download_weight.sh
  1. Download inference results of our model. (Optional)
bash script/Download_result.sh

Data generation

  1. Run OpenPose for the images in the dataset. For HICO-DET, the OpenPose result could be downloaded from this link.

  2. Create the environment used for this phase.

conda create --name DJR-data --file requirements_data.txt
conda activate DJR-data
  1. Filter the OpenPose result.

python script/filter_pose.py --ori <path to your OpenPose result> --fil <path to save the filtered result>

  1. Run SMPLify-X on the dataset with the filtered pose.

  2. Assign the SMPLify-X results to the training and testing data.

python script/assign_pose_GT.py --pose <path to your pose used for SMPLify-X> --res <path to your SMPLify-X result>
python script/assign_pose_Neg.py --pose <path to your pose used for SMPLify-X> --res <path to your SMPLify-X result>
python script/assign_pose_test.py --pose <path to your pose used for SMPLify-X> --res <path to your SMPLify-X result>
  1. Generate 3D spatial configuration.
python script/generate_3D_obj_GT.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --img_path <path to your HICO train image>  --save_obj_path <path to save your object mesh and pkl>  
python script/generate_3D_obj_Neg.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --img_path <path to your HICO train image>  --save_obj_path <path to save your object mesh and pkl>  
python script/generate_3D_obj_test.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --img_path <path to your HICO test image>  --save_obj_path <path to save your object mesh and pkl>  
python script/rotate_sampling_GT.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --obj_path <path to your object vertexs>  --save_path <path to save the spatial configuration>
python script/rotate_sampling_Neg.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --obj_path <path to your object vertexs>  --save_path <path to save the spatial configuration>
python script/rotate_sampling_test.py --smplx_path <path of the smplx model> --res <path to your SMPLify-X result> --obj_path <path to your object vertexs>  --save_path <path to save the spatial configuration>
  1. Transfer the results to fit in Python 2.7

python script/transfer_py3-py2.py --res <Path to your SMPLify-X result>

3D Human-Object Interaction Volume Generation and Visualization

We provide a Jupyter Notebook demo for quick start in script/Demo.ipynb.

Extract feature using PointNet

  1. Clone the PointNet repo (https://github.com/charlesq34/pointnet.git), and copy the necessary files.
git clone https://github.com/charlesq34/pointnet.git
cp Feature_extraction/Feature_extraction.py pointnet/Feature_extraction.py
cp Feature_extraction/pointnet_hico.py pointnet/models/pointnet_hico.py
  1. Install PointNet following instruction.

  2. Extract feature

cd pointnet
python script/Download_data.py 1l48pyX-9FWFMNuokdbBp6KshKSDBihAe Feature_extraction.tar
tar -xvf Feature_extraction.tar
python Feature_extraction.py --input_list script/vertex_path_GT.txt --model_path ../Feature_extraction/model_10000.ckpt
python Feature_extraction.py --input_list script/vertex_path_Neg.txt --model_path ../Feature_extraction/model_10000.ckpt
python Feature_extraction.py --input_list script/vertex_path_Test.txt --model_path ../Feature_extraction/model_10000.ckpt
  1. Concatenate the extracted feature with the corresponding dim-reduced word vector.
python script/concat_w2v.py --SMPLX_PATH <path to your SMPL-X results> --GT ./Data/Trainval_GT_HICO_with_idx.pkl --Neg Trainval_Neg_HICO_with_idx.pkl --Test Test_Faster_RCNN_R-50-PFN_2x_HICO_DET_with_idx.pkl

Experiments with our model

  1. Create the environment used for this phase.
conda create --name DJR --file requirements_DJR.txt
conda activate DJR
  1. Train on HICO-DET

python tools/Train_HICO_DET_DJR.py --model <your model name> --num_iteration 400000

  1. Test and generate detection file on HICO-DET
python tools/Test_HICO_DET_DJR.py --model <your model name> --iteration 400000
python ./-Results/Generate_detection.py --model <your test output directory, under ./-Results by default>
  1. To evaluate the performance of our model on HICO-DET, run

python ./-Results/Evaluate_HICO_DET.py --file ./-Results/Detection_400000_DJR.pkl

  1. Test and generate detection file on Anbiguous-HOI

python tools/Test_ambiguous_DJR.py --model <your model name> --iteration 400000

  1. To evaluate the performance of our model on Ambiguous-HOI, run

python ./-Results/Evaluate_ambiguous.py ./-Results/400000_DJR_ambiguous.pkl DJR_ambiguous/

Tips

  1. As the data generation pipeline is long, you may find some useful common quetions in the issues.
  2. NaN loss: sometimes the training is not stable due to the align loss that needs careful tuning. We also recommend the MSE loss instead of KL divergence that can also achieve decent performance and is easier to train. More please refer to this issue.

Citation

If you find our work useful, please consider citing:

@inproceedings{li2020detailed,
title={Detailed 2D-3D Joint Representation for Human-Object Interaction},
author={Li, Yong-Lu and Liu, Xinpeng and Lu, Han and Wang, Shiyi and Liu, Junqi and Li, Jiefeng and Lu, Cewu},
booktitle={CVPR},
year={2020}
}

TODOS

  • [x] Ambiguous-HOI data and evaluation
  • [x] Full model
  • [x] 3D human-object generation and visualization
  • [ ] New and upgraded PyTorch version

Acknowledgement

Some of the codes are built upon Interactiveness.

If you get any problems or if you find any bugs, don't hesitate to comment on GitHub or make a pull request!

DJ-RN is freely available for free non-commercial use, and may be redistributed under these conditions. For commercial queries, please drop an e-mail. We will send the detail agreement to you.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].