This archive contains C++ code for the Style Transfer project. Visual Studio 2013 or above is required to compile the code. Our code is released under GPL v3 license.
- Open Visual Studio solution
build/Style.sln
- Select targeting configurations (
Release | x64
is recommended) - Build the solution by pressing
F7
- Occasionally Visual Studio will complain about the error below. The reason for this error may be the heavy dependencies of other third party libraries in this project. If this happens, just build the solution one more time.
error C1002: compiler is out of heap space in pass 2
- After compiling the project, the binary executables are inside folder
output
- Download the demo data set from the project page. Unzip the file to anywhere you want. You should now have a folder named
data
. - In Visual Studio, right click project
StyleSynthesis
>Properties
. From the left-side panel, selectConfiguration Properties
>Debugging
. On the right-side window, make sure theCommand Arguments
andWorking Directory
are correct. - The
Working Directory
should be the path to the folderdata
. TheCommand Arguments
should be the path to the*.cfg
configuration file within any demo case folder (path should be relative to thedata
folder) - Run the program by pressing
Ctrl+F5
. Take a cup of coffee. - After the program finishes running, the synthesized shapes should be in the
output
folder within each case folder.
The main entry point of the program is in file src/StyleSynthesis/main.cpp
. The entire pipeline contains several steps handled by different classes. The class definitions of all those pipeline classes are inside folder src/StyleSynthesis/IO/Pipeline
. Below is a brief explanation of the purpose of each class:
- Pre-Processing
PipelineMeshIO
: pre-process input meshesPipelineCurveIO
: extract feature curves from meshesPipelineSegmentIO
: hierarchically segment input meshesPipelineGraphIO
: build context graph for compatibility measurePipelineFeatureIO
: compute shape featuresPipelineSimilarityIO
: compute stuffs related to style similarity
- Learning
PipelineTrainPartIO
: organize data for learning part compatibilityPipelineTrainLearningIO
: learn weights for part compatibilityPipelineTrainCurveIO
: learn weights for curve compatibilityPipelineTrainValidationIO
: learn stuffs for validation
- Style Transfer
PipelineMatchPartIO
: transfer style by element substitution/addition/removalPipelineMatchCurveIO
: transfer style by curve-based deformation
- All third-party library header files and pre-built binary files are included in folder
3rdparty
- This project requires OpenGL. You will need an OpenGL capable graphics card and development environment
- All third-party libraries used in this project are listed below:
- CML 1.0.3: simple vector, matrix and quaternion operations
- cppoptlib: L-BFGS solver
- Eigen 3.2.7: advanced matrix operations
- FFTW 3.3.4: discrete Fourier transform
- GLEW 1.11.0: OpenGL Extension Wrangler Library
- libigl: tetrahedral mesh manipulation
- Thea: Kd tree implementation (modified)
- If you would like to use our code, please cite the following paper:
Zhaoliang Lun, Evangelos Kalogerakis, Rui Wang, Alla Sheffer, "Functionality Preserving Shape Style Transfer", ACM Transactions on Graphics (Proc. ACM SIGGRAPH ASIA 2016)
- For any questions or comments, please contact Zhaoliang Lun (zhaoliang.lun@gmail.com)