Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Visual Studio - From Beginning to End #5

Open
tmsc5 opened this issue Sep 12, 2019 · 1 comment
Open

Building on Visual Studio - From Beginning to End #5

tmsc5 opened this issue Sep 12, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@tmsc5
Copy link

tmsc5 commented Sep 12, 2019

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

@chongyi-zheng
Copy link
Owner

Thanks for your contribution!
Would you please create a PR to document this in a markdown file?
I will take a look and add a link to the file in my README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants