Shape2Pose - Code
← Home

Download sourcecode and precompiled binaries
See input data and file formats

Running the executables

We distribute pre-compiled MacOS 10.9.2 and Linux binaries (64-bit). Before you run the scripts make sure that (1) the binaries in the appropriate directory (./scripts/{Linux,Darwin}/) are compatible with your OS, if not, re-compile the code (see next section for instructions), (2) also verify that scikit is installed (if not, see these instructions). You might need to edit 'pythonname' variable in scripts/scriptlibs/fas.py based on the python version that you link to scikit.

Here are the available scripts (run a script without arguments to see use instructions):
          train.py - train a pose predictor (requires meshes with annotated poses).
          test.py - predict poses for new shapes (trained with command above)
          leaveOneOut.py - run leave-one-out experiments (requires meshes with annotated poses)
          visualize.py - visualize a resulting pose

Note that there is a particular directory structure required for successful execution of these scripts. Namely, ./data/ directory should be in the same directory as ./scripts/, and the current directory should be ./scripts when running the *.py files. See script instructions or "small" example for explanation on directory structure (much of it is irrelevant since unless you need to access intermediate data).
NOTE: some steps of our framework were re-implemented to improve distributability. Let me know if you find bugs or observe unexpected results.

Compiling Instructions

Compiling

Just type 'make' to compile. In addition you will need scikit-learn at run time.

Note that you can enable offscreen rendering by setting MESA_RENDERING="true" and GLUT_RENDERING="false" in code/makefiles/makefile.std (if you set it, visualize.py script would not work!)

Data directory structure

Only some content of ./data directory is relevant for the most users, in particular:
        ./data/1_input/DATASET/ - any dataset should have its own directory with off subdirectory that contains all meshes in *.off format. Optionally, it can also include a gt subdirectory with ground truth poses (this is necessary if you want to train a pose predictor).
        ./data/5_images/experiments/EXPERIMENT/ contains a few directories with images of results:
                poses/MODELNAME/pose0.jpg is an image of the best pose,
                posessummary/MODELNAME/pnterrs.png shows the accuracy curves for all joints (blue) and contact points only (red)
                predict/MODELNAME/X.jpg shows images of candidate contact regions, where X is region ID.
        ./data/4_experiments/4_poses/*/*.pose.txt pose files (same format as the ground truth poses).

Here is a brief description for the content of other directories:
        2_analysis/DATASET/points/POINT_SET/MODELNAME.pts - each line contains a point description: face_id barycentric_b123 position_xyz
        2_analysis/DATASET/features/FEATURE_NAME/MODELNAME.arff - feature file (Attribute-Relation File Format), each line contains features for points in even1000 set.
        3_trained - trained pose priors and feature-based classifiers for contact points
        4_experiments/EXPERIMENT/1_prediction/MODELNAME.arff - predicted contact points in leave-one-out experiments
        4_experiments/EXPERIMENT/4_poses/MODELNAME/{bindings.bin, pose.txt} - predicted poses

Code structure

Python scripts are used to connect several apps. Below is a list of the most relevant apps and libraries (found in Apps and Libs directories).

Apps:
FnAlignPredict a pose
FnRegionClassifierClassify contact points (train / test), the classifier itself is actually a python script (scriptlibs/randomforest.py) that uses scikit.
FnTrainPosePriorTrain a pose prior
FnBenchmarkEvaluate the predicted pose, can also be used to annotate poses for new shapes.

Libs:
HumanActorAll code related to pose prediction
DatabaseCoreEverything on shape representation: Model3D includes various geometries (points, meshes, ect..) and functions on shapes.
Renderer*/VisualizationRendering / visualization. Renderer abstracts the canvas (using GLUT or MESA). Visualization includes ALL OpenGL calls, thus drawing is limited to that library (and DBApps).
BasicNumerical/BasicRoutinesSome supporting libraries.