dicarlolab / genthor

Generative models and Bayesian techniques with thor
5 stars 12 forks source link

Introduction

Genthor is about integrating generative models and Bayesian techniques with thor.

Genthor setup

cd PATH_TO_GENTHOR
git clone https://github.com/dicarlolab/genthor.git
cd genthor
python setup.py install
mkdir ~/.skdata/genthor
cp PATH_TO_GENTHOR/genthor/genthor/modeltools/obj_Bscript.py ~/.skdata/genthor

Installing dependencies

General packages

(You must have root to install these packages)

apt-get install bison flex
apt-get install -y -q libgl1-mesa-dev
apt-get install -y -q libtiff4-dev
apt-get install -y -q libsdl1.2-dev

Blender

wget http://download.blender.org/release/Blender2.68/blender-2.68a-linux-glibc211-x86_64.tar.bz2
ln -s ~/PATH_TO_BLENDER_INSTALL/blender ~/bin/blender
# For example:
# ln -s ~/render/blender-2.68a-linux-glibc211-x86_64/blender ~/bin/blender

Panda

#load-display pandagl
#load-display pandadx9
#load-display pandadx8
#load-display pandagles
load-display p3tinydisplay

NOTE: The point of making this change is to allow panda to render to an off-screen buffer, so that it can run on machines without displays (e.g. servers). This is an installation-specific thing that, if you were running on your own personal desktop and wanted to see things on the screen as they rendered, you could leave it as it was (e.g. pandagl).

python makepanda/installpanda.py --prefix=/[PATHYOUWANTTOINSTALLIN]
export PYTHONPATH=$PYTHONPATH:[PATH_TO_PANDA_INSTALL]/lib/panda3d:[PATH_TO_PANDA_INSTALL]/share/panda3d

Bare minimum testing (in Python)

import genthor.datasets as gd
# When you run genthor for the first time, it will need to load background and models. 
# You can do this by:
meta = dataset.meta
# after define your models, you will need to load models
dataset.get_models()

Converting .obj to .egg

To convert .obj to .egg, you need Blender and the Yabee exporter add-on. The code was tested on Blender 2.63 and Yabee r12 for Blender2.63a. See blender.org and code.google.com/p/yabee for those versions.

Resource organization

Here is the organization for your models and backgrounds that you must observe if you want model/background loading to work properly.

The resources directory is the root of all models and backgrounds, and within resources there are up to 5 sub-directories: