From dcf1fe9761932480f7822767f3b376523c518187 Mon Sep 17 00:00:00 2001 From: zhengyiluo Date: Fri, 23 Apr 2021 15:42:53 +0000 Subject: [PATCH 1/3] centering joints to apply correct translation --- smplpytorch.egg-info/PKG-INFO | 82 +++++++++++++++++++++++ smplpytorch.egg-info/SOURCES.txt | 16 +++++ smplpytorch.egg-info/dependency_links.txt | 1 + smplpytorch.egg-info/requires.txt | 5 ++ smplpytorch.egg-info/top_level.txt | 1 + smplpytorch/pytorch/smpl_layer.py | 5 ++ 6 files changed, 110 insertions(+) create mode 100644 smplpytorch.egg-info/PKG-INFO create mode 100644 smplpytorch.egg-info/SOURCES.txt create mode 100644 smplpytorch.egg-info/dependency_links.txt create mode 100644 smplpytorch.egg-info/requires.txt create mode 100644 smplpytorch.egg-info/top_level.txt diff --git a/smplpytorch.egg-info/PKG-INFO b/smplpytorch.egg-info/PKG-INFO new file mode 100644 index 0000000..ae3c2f0 --- /dev/null +++ b/smplpytorch.egg-info/PKG-INFO @@ -0,0 +1,82 @@ +Metadata-Version: 2.1 +Name: smplpytorch +Version: 0.0.1 +Summary: SMPL human body layer for PyTorch is a differentiable PyTorch layer +Home-page: https://github.com/gulvarol/smplpytorch +Author: Gul Varol +Author-email: gulvarols@gmail.com +License: UNKNOWN +Description: SMPL layer for PyTorch + ======= + + [SMPL](http://smpl.is.tue.mpg.de) human body [\[1\]](#references) layer for [PyTorch](https://pytorch.org/) (tested with v0.4 and v1.x) + is a differentiable PyTorch layer that deterministically maps from pose and shape parameters to human body joints and vertices. + It can be integrated into any architecture as a differentiable layer to predict body meshes. + The code is adapted from the [manopth](https://github.com/hassony2/manopth) repository by [Yana Hasson](https://github.com/hassony2). + +

+ smpl +

+ + + ## Setup + + ### 1. The `smplpytorch` package + * **Run without installing:** You will need to install the dependencies listed in [environment.yml](environment.yml): + * `conda env update -f environment.yml` in an existing environment, or + * `conda env create -f environment.yml`, for a new `smplpytorch` environment + * **Install:** To import `SMPL_Layer` in another project with `from smplpytorch.pytorch.smpl_layer import SMPL_Layer` do one of the following. + * Option 1: This should automatically install the dependencies. + ``` bash + git clone https://github.com/gulvarol/smplpytorch.git + cd smplpytorch + pip install . + ``` + * Option 2: You can install `smplpytorch` from [PyPI](https://pypi.org/project/smplpytorch/). Additionally, you might need to install [chumpy](https://github.com/hassony2/chumpy.git). + ``` bash + pip install smplpytorch + ``` + + ### 2. Download SMPL pickle files + * Download the models from the [SMPL website](http://smpl.is.tue.mpg.de/) by choosing "SMPL for Python users". Note that you need to comply with the [SMPL model license](http://smpl.is.tue.mpg.de/license_model). + * Extract and copy the `models` folder into the `smplpytorch/native/` folder (or set the `model_root` parameter accordingly). + + ## Demo + + Forward pass the randomly created pose and shape parameters from the SMPL layer and display the human body mesh and joints: + + `python demo.py` + + ## Acknowledgements + The code **largely** builds on the [manopth](https://github.com/hassony2/manopth) repository from [Yana Hasson](https://github.com/hassony2), which implements the [MANO](http://mano.is.tue.mpg.de) hand model [\[2\]](#references) layer. + + The code is a PyTorch port of the original [SMPL](http://smpl.is.tue.mpg.de) model from [chumpy](https://github.com/mattloper/chumpy). It builds on the work of [Loper](https://github.com/mattloper) et al. [\[1\]](#references). + + The code [reuses](https://github.com/gulvarol/smpl/pytorch/rodrigues_layer.py) [part of the code](https://github.com/MandyMo/pytorch_HMR/blob/master/src/util.py) by [Zhang Xiong](https://github.com/MandyMo) to compute the rotation utilities. + + If you find this code useful for your research, please cite the original [SMPL](http://smpl.is.tue.mpg.de) publication: + + ``` + @article{SMPL:2015, + author = {Loper, Matthew and Mahmood, Naureen and Romero, Javier and Pons-Moll, Gerard and Black, Michael J.}, + title = {{SMPL}: A Skinned Multi-Person Linear Model}, + journal = {ACM Trans. Graphics (Proc. SIGGRAPH Asia)}, + number = {6}, + pages = {248:1--248:16}, + volume = {34}, + year = {2015} + } + ``` + + ## References + + \[1\] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black, "SMPL: A Skinned Multi-Person Linear Model," SIGGRAPH Asia, 2015. + + \[2\] Javier Romero, Dimitrios Tzionas, and Michael J. Black, "Embodied Hands: Modeling and Capturing Hands and Bodies Together," SIGGRAPH Asia, 2017. + +Platform: UNKNOWN +Classifier: Programming Language :: Python :: 3 +Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) +Classifier: Operating System :: OS Independent +Requires-Python: >=3.5.0 +Description-Content-Type: text/markdown diff --git a/smplpytorch.egg-info/SOURCES.txt b/smplpytorch.egg-info/SOURCES.txt new file mode 100644 index 0000000..9d4ea40 --- /dev/null +++ b/smplpytorch.egg-info/SOURCES.txt @@ -0,0 +1,16 @@ +README.md +setup.py +smplpytorch/__init__.py +smplpytorch.egg-info/PKG-INFO +smplpytorch.egg-info/SOURCES.txt +smplpytorch.egg-info/dependency_links.txt +smplpytorch.egg-info/requires.txt +smplpytorch.egg-info/top_level.txt +smplpytorch/native/__init__.py +smplpytorch/native/webuser/__init__.py +smplpytorch/native/webuser/posemapper.py +smplpytorch/native/webuser/serialization.py +smplpytorch/pytorch/__init__.py +smplpytorch/pytorch/rodrigues_layer.py +smplpytorch/pytorch/smpl_layer.py +smplpytorch/pytorch/tensutils.py \ No newline at end of file diff --git a/smplpytorch.egg-info/dependency_links.txt b/smplpytorch.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/smplpytorch.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/smplpytorch.egg-info/requires.txt b/smplpytorch.egg-info/requires.txt new file mode 100644 index 0000000..2cfaa69 --- /dev/null +++ b/smplpytorch.egg-info/requires.txt @@ -0,0 +1,5 @@ +opencv-python +matplotlib +numpy +torch +chumpy@ git+ssh://git@github.com/hassony2/chumpy diff --git a/smplpytorch.egg-info/top_level.txt b/smplpytorch.egg-info/top_level.txt new file mode 100644 index 0000000..e61965a --- /dev/null +++ b/smplpytorch.egg-info/top_level.txt @@ -0,0 +1 @@ +smplpytorch diff --git a/smplpytorch/pytorch/smpl_layer.py b/smplpytorch/pytorch/smpl_layer.py index 5e74741..0b17e54 100644 --- a/smplpytorch/pytorch/smpl_layer.py +++ b/smplpytorch/pytorch/smpl_layer.py @@ -149,6 +149,11 @@ def forward(self, th_jtr = th_jtr - center_joint th_verts = th_verts - center_joint else: + if self.center_idx is not None: + ## Zero out root first + center_joint = th_jtr[:, self.center_idx].unsqueeze(1) + th_jtr = th_jtr - center_joint + th_verts = th_verts - center_joint th_jtr = th_jtr + th_trans.unsqueeze(1) th_verts = th_verts + th_trans.unsqueeze(1) From 44804ea105ee4d19133d86bdb9a71794d4fb29a7 Mon Sep 17 00:00:00 2001 From: zhengyiluo Date: Fri, 23 Apr 2021 15:45:51 +0000 Subject: [PATCH 2/3] removing egg_info --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 372a5d8..7e53455 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .cache/ .egg-info +smplpytorch.egg-info/ __pycache__/ build/ dist/ From a9bd531b699367aefa99047711dcd83ef9ae9a1e Mon Sep 17 00:00:00 2001 From: zhengyiluo Date: Fri, 23 Apr 2021 15:46:32 +0000 Subject: [PATCH 3/3] centering_joints --- smplpytorch.egg-info/PKG-INFO | 82 ----------------------- smplpytorch.egg-info/SOURCES.txt | 16 ----- smplpytorch.egg-info/dependency_links.txt | 1 - smplpytorch.egg-info/requires.txt | 5 -- smplpytorch.egg-info/top_level.txt | 1 - 5 files changed, 105 deletions(-) delete mode 100644 smplpytorch.egg-info/PKG-INFO delete mode 100644 smplpytorch.egg-info/SOURCES.txt delete mode 100644 smplpytorch.egg-info/dependency_links.txt delete mode 100644 smplpytorch.egg-info/requires.txt delete mode 100644 smplpytorch.egg-info/top_level.txt diff --git a/smplpytorch.egg-info/PKG-INFO b/smplpytorch.egg-info/PKG-INFO deleted file mode 100644 index ae3c2f0..0000000 --- a/smplpytorch.egg-info/PKG-INFO +++ /dev/null @@ -1,82 +0,0 @@ -Metadata-Version: 2.1 -Name: smplpytorch -Version: 0.0.1 -Summary: SMPL human body layer for PyTorch is a differentiable PyTorch layer -Home-page: https://github.com/gulvarol/smplpytorch -Author: Gul Varol -Author-email: gulvarols@gmail.com -License: UNKNOWN -Description: SMPL layer for PyTorch - ======= - - [SMPL](http://smpl.is.tue.mpg.de) human body [\[1\]](#references) layer for [PyTorch](https://pytorch.org/) (tested with v0.4 and v1.x) - is a differentiable PyTorch layer that deterministically maps from pose and shape parameters to human body joints and vertices. - It can be integrated into any architecture as a differentiable layer to predict body meshes. - The code is adapted from the [manopth](https://github.com/hassony2/manopth) repository by [Yana Hasson](https://github.com/hassony2). - -

- smpl -

- - - ## Setup - - ### 1. The `smplpytorch` package - * **Run without installing:** You will need to install the dependencies listed in [environment.yml](environment.yml): - * `conda env update -f environment.yml` in an existing environment, or - * `conda env create -f environment.yml`, for a new `smplpytorch` environment - * **Install:** To import `SMPL_Layer` in another project with `from smplpytorch.pytorch.smpl_layer import SMPL_Layer` do one of the following. - * Option 1: This should automatically install the dependencies. - ``` bash - git clone https://github.com/gulvarol/smplpytorch.git - cd smplpytorch - pip install . - ``` - * Option 2: You can install `smplpytorch` from [PyPI](https://pypi.org/project/smplpytorch/). Additionally, you might need to install [chumpy](https://github.com/hassony2/chumpy.git). - ``` bash - pip install smplpytorch - ``` - - ### 2. Download SMPL pickle files - * Download the models from the [SMPL website](http://smpl.is.tue.mpg.de/) by choosing "SMPL for Python users". Note that you need to comply with the [SMPL model license](http://smpl.is.tue.mpg.de/license_model). - * Extract and copy the `models` folder into the `smplpytorch/native/` folder (or set the `model_root` parameter accordingly). - - ## Demo - - Forward pass the randomly created pose and shape parameters from the SMPL layer and display the human body mesh and joints: - - `python demo.py` - - ## Acknowledgements - The code **largely** builds on the [manopth](https://github.com/hassony2/manopth) repository from [Yana Hasson](https://github.com/hassony2), which implements the [MANO](http://mano.is.tue.mpg.de) hand model [\[2\]](#references) layer. - - The code is a PyTorch port of the original [SMPL](http://smpl.is.tue.mpg.de) model from [chumpy](https://github.com/mattloper/chumpy). It builds on the work of [Loper](https://github.com/mattloper) et al. [\[1\]](#references). - - The code [reuses](https://github.com/gulvarol/smpl/pytorch/rodrigues_layer.py) [part of the code](https://github.com/MandyMo/pytorch_HMR/blob/master/src/util.py) by [Zhang Xiong](https://github.com/MandyMo) to compute the rotation utilities. - - If you find this code useful for your research, please cite the original [SMPL](http://smpl.is.tue.mpg.de) publication: - - ``` - @article{SMPL:2015, - author = {Loper, Matthew and Mahmood, Naureen and Romero, Javier and Pons-Moll, Gerard and Black, Michael J.}, - title = {{SMPL}: A Skinned Multi-Person Linear Model}, - journal = {ACM Trans. Graphics (Proc. SIGGRAPH Asia)}, - number = {6}, - pages = {248:1--248:16}, - volume = {34}, - year = {2015} - } - ``` - - ## References - - \[1\] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black, "SMPL: A Skinned Multi-Person Linear Model," SIGGRAPH Asia, 2015. - - \[2\] Javier Romero, Dimitrios Tzionas, and Michael J. Black, "Embodied Hands: Modeling and Capturing Hands and Bodies Together," SIGGRAPH Asia, 2017. - -Platform: UNKNOWN -Classifier: Programming Language :: Python :: 3 -Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) -Classifier: Operating System :: OS Independent -Requires-Python: >=3.5.0 -Description-Content-Type: text/markdown diff --git a/smplpytorch.egg-info/SOURCES.txt b/smplpytorch.egg-info/SOURCES.txt deleted file mode 100644 index 9d4ea40..0000000 --- a/smplpytorch.egg-info/SOURCES.txt +++ /dev/null @@ -1,16 +0,0 @@ -README.md -setup.py -smplpytorch/__init__.py -smplpytorch.egg-info/PKG-INFO -smplpytorch.egg-info/SOURCES.txt -smplpytorch.egg-info/dependency_links.txt -smplpytorch.egg-info/requires.txt -smplpytorch.egg-info/top_level.txt -smplpytorch/native/__init__.py -smplpytorch/native/webuser/__init__.py -smplpytorch/native/webuser/posemapper.py -smplpytorch/native/webuser/serialization.py -smplpytorch/pytorch/__init__.py -smplpytorch/pytorch/rodrigues_layer.py -smplpytorch/pytorch/smpl_layer.py -smplpytorch/pytorch/tensutils.py \ No newline at end of file diff --git a/smplpytorch.egg-info/dependency_links.txt b/smplpytorch.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/smplpytorch.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/smplpytorch.egg-info/requires.txt b/smplpytorch.egg-info/requires.txt deleted file mode 100644 index 2cfaa69..0000000 --- a/smplpytorch.egg-info/requires.txt +++ /dev/null @@ -1,5 +0,0 @@ -opencv-python -matplotlib -numpy -torch -chumpy@ git+ssh://git@github.com/hassony2/chumpy diff --git a/smplpytorch.egg-info/top_level.txt b/smplpytorch.egg-info/top_level.txt deleted file mode 100644 index e61965a..0000000 --- a/smplpytorch.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -smplpytorch