Giter Site home page Giter Site logo

chongyi-zheng / smplpp Goto Github PK

View Code? Open in Web Editor NEW
252.0 9.0 58.0 27.38 MB

C++ Implementation of SMPL: A Skinned Multi-Person Linear Model

License: MIT License

CMake 0.82% C++ 96.87% Python 2.31%
graphics-3d human-modeling smpl shape-detection pose-estimation cpp

smplpp's People

Contributors

chongyi-zheng avatar mmurooka avatar yuki-koyama 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

smplpp's Issues

which gcc version do you use,I complied print so many error

like this
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:50:35: note: in definition of macro ‘smpl_error’
#define smpl_error(module, error) Exception(module, error,
^~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:154:5: note: initializing argument 4 of ‘xt::smpl::Exception::Exception(int, int, int, int, int)’
Exception(const std::string module, const std::string error,
^~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:50:35: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
#define smpl_error(module, error) Exception(module, error,
^~~~~~~~~~~~~~~~~~~~~~~~~~
func, FILE, LINE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:50:35: note: in definition of macro ‘smpl_error’
#define smpl_error(module, error) Exception(module, error,
^~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:154:5: note: initializing argument 1 of ‘xt::smpl::Exception::Exception(int, int, int, int, int)’
Exception(const std::string module, const std::string error,
^~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:50:35: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
#define smpl_error(module, error) Exception(module, error,
^~~~~~~~~~~~~~~~~~~~~~~~~~
func, FILE, LINE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/smplc++/SMPLpp-master/include/toolbox/Exception.h:50:35: note: in definition of macro ‘smpl_error’
#define smpl_error(module, error) Exception(module, error,
^~~~~~~~~

What is the speed of smplpp?

I have run the smplpp on windows platform with vs2019. And the smplpp takes 20ms for a new pose on my notebook.
However, when I tested the official python code on windows with python2.7, they spent less than 10s for a new pose.
Could you please tell me the performance on your side? Either Linux or Windows. Thanks.

no chumpy.ch

屏幕截图 2022-09-29 103320

please how to tackle this problem? no module named chumpy.ch

Any solution on [json.exception.parse_error.101]?

./smplpp

[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: 'v'
sizes() called on undefined Tensor (sizes at /pytorch/c10/core/UndefinedTensorImpl.cpp:12)
frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f64538a2441 in /usr/local/lib/libc10.so)
frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f64538a1d7a in /usr/local/lib/libc10.so)
frame #2: c10::UndefinedTensorImpl::sizes() const + 0x6f (0x7f645389b62f in /usr/local/lib/libc10.so)
frame #3: at::Tensor::sizes() const + 0x27 (0x4e54b9 in ./smplpp)
frame #4: smpl::LinearBlendSkinning::getVertex() + 0x8e (0x4f0848 in ./smplpp)
frame #5: smpl::SMPL::out(long) + 0x6a (0x4f68d8 in ./smplpp)
frame #6: main + 0x4ce (0x4d396e in ./smplpp)
frame #7: __libc_start_main + 0xf0 (0x7f640f99d830 in /lib/x86_64-linux-gnu/libc.so.6)
frame #8: _start + 0x29 (0x4d2729 in ./smplpp)

After successfully compiling your code, this is what I got..

  1. ../source/main.cpp
    std::string modelPath = "../data/smpl_female.json";

In "main.cpp", this program is supposed to get the hard-coded json file.

  1. ../data/smpl_female.json
    version https://git-lfs.github.com/spec/v1
    oid sha256:d861bd0e3d53b9021f98147e39765b894e77b428cdab9f470d038a7ac324a355
    size 192829745

When I opened the input file, I wonder if there's anything wrong in the input json file.

CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create' collect2: error: ld returned 1 exit status

Question: I have encountered the error when compiling the project by cmake tools.
Run Build Command:"/usr/bin/make" "cmTC_c29db/fast"
/usr/bin/make -f CMakeFiles/cmTC_c29db.dir/build.make CMakeFiles/cmTC_c29db.dir/build
make[1]: Entering directory '/home/ubuntu/Downloads/SMPLpp-master/SMPL++/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c29db.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_c29db.dir/CheckSymbolExists.c.o -c /home/ubuntu/Downloads/SMPLpp-master/SMPL++/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_c29db
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c29db.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_c29db.dir/CheckSymbolExists.c.o -o cmTC_c29db
CMakeFiles/cmTC_c29db.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference to pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_c29db.dir/build.make:97: recipe for target 'cmTC_c29db' failed
make[1]: *** [cmTC_c29db] Error 1
make[1]: Leaving directory '/home/ubuntu/Downloads/SMPLpp-master/SMPL++/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_c29db/fast' failed
make: *** [cmTC_c29db/fast] Error 2

File /home/ubuntu/Downloads/SMPLpp-master/SMPL++/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ubuntu/Downloads/SMPLpp-master/SMPL++/build/CMakeFiles/CMakeTmp

Building on Visual Studio - From Beginning to End

I know this isn't the most appropriate place to put this, but I struggled with this for a while and wanted to help anyone go through with it.

Step 1:

After git clone of the repository, and CMake GUI has been downloaded, configure the repository, you'll get multiple errors, such as not finding cuDNN (Install it), missing libraries, simply set the values to existing folders, some want the directories of lib files, include folders, and most of them just want the path to share folders. I use vcpkg personally, so after the installing the needed libraries, everything is inside packages/library folder name/needed folder, either includes/lib or share. It will ask for nlohmann_json, xtensor, xtl, Caffe2, C10, Torch. libTorch can just be downloaded from their website, thankfully they have prebuilt binaries there, use those.

Step 2:

After Configure/Generate have been successful, open the project with Visual Studio, go to Project -> smplpp Properties -> Linker -> Input -> Additional Dependencies, delete stdc++fs.lib as a dependency. Then open the def.h header file, and include stdint.h (Note: Make sure it's NOT inside the smpl namespace)

Step 3:

Simply build the project, after it's done, set smplpp as a "StartUp Project"

Step 4:

You'll need Linux, either installed natively on your PC/Laptop or in a virtual machine (VirtualBox in my case). This step will simply NOT work on Windows, don't even try. Install python2.7 and pip (if you don't have it), I also removed default python versions just in case, not really sure if it's necessary. Pip install numpy, scipy, chumpy, I'm pretty sure that's all you need.

Step 5 (Still on Linux):

Download the Python models from the website as stated in the README, and open the python script to see instructions of how to run it, it will generate an npz and a json file (It might take a minute or two) and transfer those to a USB flash, external hardrive, in some cloud storage or whatever, any means to move those files to Windows.

Step 6:

Now that smplpp has been built, and we have the necessary files, open SMPLpp-master/build and place the npz and json files there

Step 7:

Open main.cpp from smplpp and as a modelPath write either smpl_female.json or smpl_male.json and change the outputPath to whatever name you want it to be. Run smplpp and since Visual Studio sees the default folder as the parent folder of the built exe file, you can see the generated obj files there (In the SMPLpp-master/build folder).

In short:

Once again, I know this isn't the best place to put it, and I apologize. Also, the explanation might be a bit off. The short version of it is:

1. Include stdint.h in def.h

2. Delete stdc++fs.lib as a dependency

3. Run preprocess.py inside Linux

4. Transfer the files to Windows and set the path to wherever you put the json/npz files, and then just run smplpp, it will generate the obj files to the given path

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.