Newer
Older
.. vim: set fileencoding=utf-8 :
.. Andre Anjos <andre.anjos@idiap.ch>
.. Thu 17 Apr 16:59:12 2014 CEST
.. image:: https://travis-ci.org/bioidiap/xbob.ip.flandmark.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.ip.flandmark
.. image:: https://coveralls.io/repos/bioidiap/xbob.ip.flandmark/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.ip.flandmark
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.ip.flandmark.png
:target: https://github.com/bioidiap/xbob.ip.flandmark
.. image:: http://img.shields.io/pypi/v/xbob.ip.flandmark.png
:target: https://pypi.python.org/pypi/xbob.ip.flandmark
.. image:: http://img.shields.io/pypi/dm/xbob.ip.flandmark.png
:target: https://pypi.python.org/pypi/xbob.ip.flandmark
==============================
Python Bindings to flandmark
==============================
This package is a simple Boost.Python wrapper to the (rather quick) open-source
facial landmark detector `flandmark

André Anjos
committed
<http://cmp.felk.cvut.cz/~uricamic/flandmark/index.php>`_, **version 1.0.7**
(or the github state as of 10/february/2013).
If you use this package, the author asks you to cite the following paper::
author = {U{\v{r}}i{\v{c}}{\'{a}}{\v{r}}, Michal and Franc, Vojt{\v{e}}ch and Hlav{\'{a}}{\v{c}}, V{\'{a}}clav},
title = {Detector of Facial Landmarks Learned by the Structured Output {SVM}},
year = {2012},
pages = {547-556},
booktitle = {VISAPP '12: Proceedings of the 7th International Conference on Computer Vision Theory and Applications},
editor = {Csurka, Gabriela and Braz, Jos{\'{e}}},
publisher = {SciTePress --- Science and Technology Publications},
address = {Portugal},
volume = {1},
isbn = {978-989-8565-03-7},
book_pages = {747},
month = {February},
day = {24-26},
venue = {Rome, Italy},
keywords = {Facial Landmark Detection, Structured Output Classification, Support Vector Machines, Deformable Part Models},
prestige = {important},
authorship = {50-40-10},
status = {published},
project = {FP7-ICT-247525 HUMAVIPS, PERG04-GA-2008-239455 SEMISOL, Czech Ministry of Education project 1M0567},
www = {http://www.visapp.visigrapp.org},
}
You should also cite `Bob <http://www.idiap.ch/software/bob/>`_, as a core
framework::
@inproceedings{Anjos_ACMMM_2012,
author = {A. Anjos AND L. El Shafey AND R. Wallace AND M. G\"unther AND C. McCool AND S. Marcel},
title = {Bob: a free signal processing and machine learning toolbox for researchers},
year = {2012},
month = oct,
booktitle = {20th ACM Conference on Multimedia Systems (ACMMM), Nara, Japan},
publisher = {ACM Press},
url = {http://publications.idiap.ch/downloads/papers/2012/Anjos_Bob_ACMMM12.pdf},
}

André Anjos
committed
You can just add a dependence for ``xbob.ip.flandmark`` on your ``setup.py`` to

André Anjos
committed
automatically download and have this package available at your satellite
package. This works well if Bob_ is installed centrally at your machine.

André Anjos
committed
Otherwise, you will need to tell ``buildout`` how to build the package locally
and how to find Bob_. For that, just add a custom egg recipe to your

André Anjos
committed
buildout that will fetch the package and compile it locally, setting the
buildout variable ``prefixes`` to where Bob_ is installed (a build directory

André Anjos
committed
will work as well). For example::

André Anjos
committed
[buildout]
parts = flandmark <other parts here...>
...

André Anjos
committed
prefixes = /Users/andre/work/bob/build/debug

André Anjos
committed
...
[flandmark]

André Anjos
committed
recipe = xbob.buildout:develop

André Anjos
committed
...
To develop these bindings, you will need the open-source library Bob_ installed
somewhere. At least version 1.1 of Bob is required. If you have compiled Bob
yourself and installed it on a non-standard location, you will need to note
down the path leading to the root of that installation.
Just type::
$ python bootstrap.py
$ ./bin/buildout
If Bob is installed in a non-standard location, edit the file ``buildout.cfg``
to set the root to Bob's local installation path. Remember to use the **same
python interpreter** that was used to compile Bob_, then execute the same steps
Usage
-----
Pretty simple, just do something like::
import bob
video = bob.io.VideoReader('myvideo.avi')
localizer = flandmark.Localizer()
print localizer(frame)
If you already have a detected bounding box, you can plug the coordinates of the bounding box into the localizer call::
landmarks = localizer(image, top, left, height, width)
In total, 8 ``landmarks`` are returned by the localizer.
For the list and the interpretation of the landmarks, please have a look `here <http://cmp.felk.cvut.cz/~uricamic/flandmark/index.php>`_.
.. warning::
Since version 1.1 of this package, the landmarks are returned in the Bob_-typical order, which is ``(y,x)``.
Please update your code to this new behavior.