Git Product home page Git Product logo

c3dpo_nrsfm's Introduction

C3DPO: Canonical 3D Pose Networks for Non-Rigid Structure From Motion

By: David Novotny, Nikhila Ravi, Benjamin Graham, Natalia Neverova, Andrea Vedaldi

This is the official implementation of C3DPO: Canonical 3D Pose Networks for Non-Rigid Structure From Motion in PyTorch.

Link to paper | Project page

alt text

Dependencies

This is a Python 3.6 package. Required packages can be installed with e.g. pip and conda:

> conda create -n c3dpo python=3.6
> pip install -r requirements.txt

The complete list of dependencies:

  • pytorch (version==1.1.0)
  • numpy
  • tqdm
  • matplotlib
  • visdom
  • pyyaml
  • tabulate

Demo

demo.py downloads and runs a pre-trained C3DPO model on a sample skeleton from the Human36m dataset and generates a 3D figure with a video of the predicted 3D skeleton:

> python ./demo.py

Note that all the outputs are dumped to a local Visdom server. You can start a Visdom server with:

> python -m visdom.server

Images are also stored to the ./data directory. The video will get exported only if there's a functioning ffmpeg callable from the command line.

Downloading data / models

Whenever needed, all datasets / pre-trained models are automatically downloaded to various folders under the ./data directory. Hence, there's no need to bother with a complicated data setup :). In case you would like to cache all the datasets for your own use, simply run the evaluate.py which downloads all the needed data during its run.

Quick start = pre-trained network evaluation

Pre-trained networks can be evaluated by calling evaluate.py:

> python evaluate.py

Note that we provide pre-trained models that will get auto-downloaded during the run of the script to the ./data/exps/ directory. Furthermore, the datasets will also be automatically downloaded in case they are not stored in ./data/datasets/.

Network training + evaluation

Launch experiment.py with the argument cfg_file set to the yaml file corresponding the relevant dataset., e.g.:

> python ./experiment.py --cfg_file ./cfgs/h36m.yaml

will train a C3DPO model for the Human3.6m dataset.

Note that the code supports visualisation in Visdom. In order to enable Visdom visualisations, first start a visdom server with:

> python -m visdom.server

The experiment will output learning curves as well as visualisations of the intermediate outputs to the visdom server.

Furthermore, the results of the evaluation will be periodically updated after every training epoch in ./data/exps/c3dpo/<dataset_name>/eval_results.json. The metrics reported in the paper correspond to 'EVAL_MPJPE_best' and 'EVAL_stress'.

For the list of all possible yaml config files, please see the ./cfgs/ directory. Each config .yaml file corresponds to a training on a different dataset (matching the name of the .yaml file). Expected quantitative results are the same as for the evaluate.py script.

Reference

If you find our work useful, please cite it using the following bibtex reference.

@inproceedings{novotny2019c3dpo,
  title={C3DPO: Canonical 3D Pose Networks for Non-Rigid Structure From Motion},
  author={Novotny, David and Ravi, Nikhila and Graham, Benjamin and Neverova, Natalia and Vedaldi, Andrea},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},
  year={2019}
}

License

C3DPO is distributed under the MIT license, as found in the LICENSE file.

Expected outputs of evaluate.py

Below are the results of the supplied pre-trained models for all datasets:

dataset               MPJPE      Stress
--------------  -----------  ----------
h36m             95.6338     41.5864
h36m_hourglass  145.021      84.693
pascal3d_hrnet   56.8909     40.1775
pascal3d         36.6413     31.0768
up3d_79kp         0.0672771   0.0406902

Note that the models have better performance than published mainly due to letting the models to train for longer.

Notes for reproducibility

Note that the performance reported above was obtained with PyTorch v1.1. If you notice differences in performance make sure to use PyTorch v1.1.

c3dpo_nrsfm's People

Contributors

davnov134 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c3dpo_nrsfm's Issues

human scale

Hey, it seems that you assumed the scale of the person is known, so if we run the model on a new dataset, and don't have human scale, we can not predict absolute 3d keypoints coordinates, right?

Applying to other dataset

Hi,
I have several images of humans in .jpg format. I am trying to extract 3D poses from these images. How am I to apply c3dpo_nrsfm to my input images?

Thanks
Mritula

kp_loc and kp_original

Hi, I notice you have normalized the original 2D keypoint coordinate to kp_loc in the dataset file, but how do you normalize it? Thanks!

where is projection matrix

when set projection_type: perspective in exconfig.yaml and run demo.py
but assert K is not None in def forward(self, kp_loc=None, kp_vis=None, class_mask=None, K=None, **kwargs):

No output when implementing evaluate.py

Hi,
I am trying to implement c3dpo_nrsfm as in github to learn it. I am neither getting any extracted 3D points nor an error. It stays as below
image

I tried the following commands in the sequence

  1. python -m visdom.server
  2. python ./experiment.py --cfg_file ./cfgs/h36m.yaml

and

  1. python -m visdom.server
  2. python ./demo.py

thanks
Mritula

About visualization

Hi, I run the demo.py but find the visualization results look totally different from the video of your project pages. (Your demo video is cooler! ) How can I draw the 3D pose just like the one on your project pages? Many thanks!

How to make it work on face

I am trying to train the model to make it work for 3D reconstruction for face. I used a 2D face landmark detector to detect 2D landmarks on face images. Then I trained the model using the same config file h36m.yaml except I set shape_basis_size=1000 as in your ICCV presentation talk slides. The training converges very fast, but when I test it, the result is not as good as seen from the image I pasted. Could you point me to how to make it work for 3D reconstruction for face? Thank you.
image
image

yaml.constructor.ConstructorError

I am facing this weird error, dont really know what to do about it. Was running it in a CONDA env. as instructed. Below can be seen a screenshot.

image

Visualizing PASCAL3D+ Results

Hi,
How do I visualize the results on PASCAL3D+ dataset.
The models and the keypoint annotations given are with respect to 124 keypoints. However, for example for a car I wish to visualize only the valid keypoints (12 in the case of PASCAL3D+). When I try to visualize by changing the model in demo.py, it plots the invalid keypoints as well.
Would really appreciate some help!

How to use it with custom dataset?

Hello, Can it be used to inferent a wild-image? And what is the keypoints' meaning? Or to say, if I get the pixel of keypoint of a wild-image, what should I do to pre-process them and get the kp_loc?

Visdom of demo program

Hello, we are very interested in your research, but we need to download the sample file from visdom to run the program. Due to the limitation of Chinese network, visdom cannot be installed and used normally. Can you provide the static folder of visdom for us to manually replace the static file in the visdom directory. Thanks.

Train custom dataset

How do I train this model on a custom dataset? What are the steps I need to follow?

can you give the preproduce code of human36M dataset?

Hello, I want to train your model by myself, but I have confuse about the input kp_loc, how can it get from 2D keypoint pixel annotations, can you provide the preproduce code? please. I will very appreciate for your kindness.

Request error when running demo.py

Error info:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /events (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002413CA92E10>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))

demo run error

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb4322c4e10>: Failed to establish a new connection: [Errno 111] Connection refused

Rendering scripts?

Dear All, thank you for your excellent contribution to the community. I was wondering about your very nice visualizations of the 3D wireframes: are there scripts you could share that automate the shading/ray tracing that you're using? Is this blender?

Thanks,
Tim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.