• Stars
    star
    222
  • Rank 172,517 (Top 4 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Basel Face Registration Pipeline

This repository contains all the code to reproduce our results from our recent publication:

  • Thomas Gerig, Andreas Morel-Forster, Clemens Blumer, Bernhard Egger, Marcel Lรผthi, Sandro Schรถnborn and Thomas Vetter "Morphable Face Models - An Open Framework" ( edoc-unibas / IEEE ) IN: 13th IEEE Conference on Automatic Face and Gesture Recognition (FG 2018) pp. 75-82

Overview

After the following information, we list all nescessary steps that you need to take to aquire and prepare the data as well as to run the pipeline and the experiments in the next sections.

Problems under Windows

When you expericence some problems under Windows while importing the data, please use the branch updateScalismoFaces.

Reporting problems and discussion

When you experience problems, you have questions or feedback please use the mailing list for Morphable face models - an open framework.

Preparation

Step 1: Folder structure and Basel reference mesh

For the registration pipeline and the experiments to work properly, some data, such as reference templates and landmarks are needed. The files are available for download at Registration Pipeline Data. The download contains the following in detail:

  • Manually clicked landmarks for the BU3D-FE database.
  • BFM reference mesh and expression means.
  • Landmarks of the reference mesh.
  • Region mask for model-building.

You can copy the content of the zip folder into pipeline-data. The coarse structure looks the following:

pipeline-data
โ”œโ”€โ”€ data
โ”‚   โ”œโ”€โ”€ incoming
โ”‚   โ”œโ”€โ”€ bu3dfe
โ”‚   โ”‚   โ”œโ”€โ”€ original
โ”œโ”€โ”€ recognition-experiment

If needed, you can change the location of the pipeline-data directory in the BU3DDataProvider.scala file.

Step 2: Bu3DFE Database

To register the BU-3DFE you have to acquire the dataset here:

BU-3DFE

and copy the /original folder to data/bu3dfe/original/.

Step 3: Sbt (Scala build tool)

We assume that you have sbt already installed. If not, please follow the instructions given here.

Generally you can run the code using SBT. An example is how to run it in the terminal with:

cd /code-directory/
sbt run

If you do not have enough memory use:

sbt -J-Xmx50g run

Then the different steps are then listed and can be executed by entering the number of the script or by using:

sbt "run-main package.Classname"

Running the Pipeline

Step 0: Data pre-processing & Folder Structure Creation

During the pipeline we do not use the BU3DFE database data directly but first convert the data to match our formats. This step is done only once as a pre-processing and the output can be reused whenever you run a new registration.

To convert the original data from the BU3DFE database to our format use the command:

sbt "run-main preprocessing.ConvertBu3DRawData"

Explain raw data preprocessing steps in script. (The script might need some cleanup.)

Step 1: Building the Neutral Prior Model

Pre-computing the neutral prior model can take quite some time. However, it has to be computed only once offline and is stored in pipeline-data/data/incoming/reference/gpmodels/.

You can run the building process with:

sbt "run-main registration.BuildNeutralPrior"

Step 2: Building the Core Expression Model

The core expression model augments the neutral model with expression deformations.

sbt "run-main registration.BuildCoreExpressionModel"

Step 3: Preprocess Landmarks

This step is used to transform the reference landmarks to the new mean of the generated models and to change the uncertainty of the individual landmarks.

sbt "run-main preprocessing.PrepareReferenceLandmarks"

Step 4: Registration

sbt -J-Xmx40g "run-main registration.Registration"

Step 5: Building the Morphable Model

The model building contains two steps:

  • First for each registration result the color is extracted using the input mesh.
  • Based on all meshes with color a model containing shape, color and expression variations is built.

This process may need some time and memory. Once the first step, the color extraction is computed it can be reused if you change for example the mask of the model that should be built. But to change this you have to out comment the corresponding line in the source code.

sbt -mem 40000 "run-main modelbuilding.ModelBuilding"

Face Reconstruction from 2D Image

First you have to download the Multi-PIE database and copy the necessary files to the correct folders. This is described in the README file in the folder recogniton-experiment (comes with seperate download of the Basel Face Pipeline Data). For those experiments you need the Basel Face Model 2009 and 2017, which can be downloaded at: Probabilistic Morphable Models

To run the 3D reconstructions from the Multi-PIE database, you may want to execute it multiple times in parallel since a single fit taks ~20 minutes:

sbt -mem 5000 "fitting.experiments.RecognitionMultiPiePose"

And to calculate the recognition scores execute:

sbt -mem 5000 "fitting.experiments.RecognitionEvaluation"

Those where the neutral scores. To perform the expression experiments, run:

sbt -mem 5000 "fitting.experiments.RecognitionMultiPieExpression"
sbt -mem 5000 "fitting.experiments.RecognitionEvaluationEx"

More Repositories

1

scalismo

Scalable Image Analysis and Shape Modelling
Scala
238
star
2

parametric-face-image-generator

Generate fully parametric face images from the Basel Face Model 2017
Scala
232
star
3

Occlusion-Robust-MoFA

Python
201
star
4

basel-face-model-viewer

Simple Viewer for the Basel Face Model 2017
Scala
161
star
5

scalismo-faces

Scalable Image Analysis and Shape Modelling: Module to work with 2d images, with a focus on face images
Scala
114
star
6

icp-proposal

Source code to the paper "A Closest Point Proposal for MCMC-based Probabilistic Surface Registration"
Scala
31
star
7

scalismo-ui

Visualization for Statistical Shape Models and Medical Images based on Scalismo.
Scala
22
star
8

GiNGR

Generalized iterative Non-Rigid Point Cloud and Surface Registration using Gaussian Process Regression
Scala
15
star
9

landmarks-clicker

A landmark clicker for 2d images. The clicked landmarks are in the format of scalismo-faces
Scala
11
star
10

probabilistic-fitting-ASM

Project to the publication "Probabilistic Fitting of Active Shape Models"
Scala
7
star
11

VSDClient

a library providing a REST client to the Virtual Skeleton Database (https://www.virtualskeleton.ch/)
Scala
5
star
12

scalismo-asm

Active Shape Model implementation in Scalismo
Scala
2
star
13

scalismo-vtk

This library enables Conversion between Scalismo and VTK and adds VTK based IO capabilities
Scala
2
star
14

pmm2018-faces

Summerschool on probabilistic morphable models. Template for face projects
Scala
2
star
15

sequential-gpmm

Code for the paper "Sequential Gaussian Process Regression for Simultaneous Pathology Detection and Shape Reconstruction"
Scala
2
star
16

scalismo-microsite

microsite for the scalismo project
Scala
2
star
17

scalismo-hdf5-json

Library to read and write files in hdf5-json format
Scala
1
star
18

posterior-shape-models-revisited

Source code and experiments accompanying the paper posterior-shape-models-revisited
Scala
1
star
19

bnn-informed-face-sampler

This is the repository to the paper "Informed MCMC with Bayesian Neural Networks for Facial Image Analysis".
1
star
20

ssia-march

Scalismo tutorial for workshop on Statistical and Shape-Based Image Analysis With Applications in Medicine
Scala
1
star
21

scalismo-native

Native libraries packaging for Scalismo
Java
1
star
22

scalismo-seed.g8

A minimal seed template for a Scalismo build
Scala
1
star
23

scalismo-faces-tutorial

A tutorial to get started with the Scalismo-Faces library
Scala
1
star
24

scalismo-tutorial

Tutorial for Scalismo and Scalismo-ui
Batchfile
1
star
25

shape-priors-from-pieces

Code repository for our MICCAI2020 ShapeMI workshop paper: "Learning Shape Priors from Pieces"
Scala
1
star