http://cmp.felk.cvut.cz/~uricamic/flandmark/

flandmark

Open-source implementation of facial landmark detector


Michal Uřičář, Vojtěch Franc

uricamic@cmp.felk.cvut.cz, xfrancv@cmp.felk.cvut.cz

The Center for Machine Perception
Czech Technical University in Prague


  • References
  • Download
  • Evaluation
  • Classifier
  • Introduction
  • News

frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" tabindex="0" vspace="0" width="100%" id="I0_1458715269356" name="I0_1458715269356" src="https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&annotation=inline&width=300&origin=http%3A%2F%2Fcmp.felk.cvut.cz&url=http%3A%2F%2Fcmp.felk.cvut.cz%2F~uricamic%2Fflandmark%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.zh_CN.Kor927U9R3Y.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCOM1aAR5Mz8vsln6BGLdMeRTpS0ZQ#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1458715269356&parent=http%3A%2F%2Fcmp.felk.cvut.cz&pfname=&rpctoken=16195321" data-gapiattached="true" title="+1" style="position: static; top: 0px; width: 300px; margin: 0px; border-style: none; left: 0px; visibility: visible; height: 24px;">

News

  • 28-04-2015 - flandmark replaced by CLandmark!
  • 11-11-2012 - New version of flandmark with better internal structure and improved MATLAB interface available!

Introduction

flandmark is an open source C library (with interface to MATLAB) implementing a facial landmark detector in static images. Detector parameters learning is written solely in MATLAB and is also part of flandmark.

The input of flandmark is an image of a face. Face detector provided by the courtesy of Eydea Recognition Ltd. was used to detect faces during the learning of parameters. However the flandmark software package includes fully-contained demo application which uses the OpenCV face detector.

flandmark (version 1.06) can be also used in python thanks to the following project: xbob.flandmark 1.0.2.

Sample results

The landmark detector processes each frame separately, i.e. temporal continuity of landmark positions is not exploited. The red rectangle is bounding box returned by the face detector, the blue rectangle represents the bounding box used to construct the input to flandmark detector (the normalized image frame).

CNN anchorwoman. Source: CNN

Resolution: 640x360, Frames: 1383, Size: 5MB

Video captured by the head camera of humanoid robot NAO.

Resolution: 320x240, Frames: 669, Size: 13MB

Movie "In Bruges".

Resolution: 720x304, Frames: 300, Size: 2.9M


Structured output classifier

flandmark uses a structured output classifier based on the Deformable Part Models (DPM). The quality of landmark configuration $\mathbf{s} = (\mathbf{s_0}, \dots, \mathbf{s_{M-1}}) \in \mathcal{S}$ for given image $I$ is measured by scoring function $f: \mathcal{I} \times \mathcal{S} \rightarrow \mathbb{R}$. The scoring function is defined as a sum of the appearance fit and the deformation cost. Exact formulation of $f$ is derived from the graph constraints:

$$ f(I, \mathbf{s}) = \sum_{i = 0}^{M - 1}{q_i(I, \mathbf{s}_i)} + \sum_{i=1}^{M-3}{g_i(\mathbf{s}_0, \mathbf{s}_i)} + g_5(\mathbf{s}_1, \mathbf{s}_5) + g_6(\mathbf{s}_2, \mathbf{s}_6) + g_7(\mathbf{s}_0, \mathbf{s}_7) $$

Functions $q_i(I, \mathbf{s}_i)\ \mathrm{and}\ g_i(\mathbf{s}_i, \mathbf{s}_j)$ (appearance fit and deformation cost) are parameterized. These parameters are learned from annotated examples using the structured output SVM algorithm.

The maximization of $f$ is solved by Dynamic Programming (DP), thanks to the form of graph constraints (directed acyclic graph). The following images show the graph constraints for the current version of flandmark with 8 components, components dimensions and the flandmark detection pipeline.

Graph constraints

Components

flandmark detector


Performance evaluaiton

Illustration of relative displacement calculation.

The detector accuracy is measured in terms of the relative deviation defined as a distance between the estimated and the ground truth landmark positions divided by the size of the face. The size of the face is defined as the distance between the center of the mouth and the midpoint between centers of the eyes. The geometric accuracy is measured by the mean relative feature displacement and the maximum relative feature displacement.

$$ \mbox{mean relative displacement} = \frac{\epsilon_0+\epsilon_1+\cdots+\epsilon_7}{8} \cdot \frac{1}{l_{\mathrm{face}}} $$ $$ \mbox{maximum relative displacement} = \max \Bigg\{ \frac{\epsilon_0}{l_{\mathrm{face}}}, \cdots, \frac{\epsilon_7}{l_{\mathrm{face}}} \Bigg\} $$

The flandmark detector is compared with three competing detectors in terms of the accuracy of the estimated landmark positions. Specifically it is compared with detectors based on the following approaches: Active Appearance Models (AAM), the Deformable Part Models (DPM) based detector of Everingham, Sivic and Zisserman and binary SVMs trained independently for each landmark.

The parameters of flandmark detector were learned on a subset of the Labeled Faces in the Wild database (LFW). All performance evaluation was done on a subset of the LFW database.


Percentage of examples from testing set that have relative deviation less or equal to 10%
  Mean deviation Maximal deviation
AAM  8.98%  0.62%
Everingham et al. 85.28% 22.93%
Independent SVMs 85.66% 34.50%
flandmark 96.59% 53.23%

Download

flandmark can be downloaded (or forked) from GitHub

Older versions:

  • Version 1.07, 2012-11-11, flandmark_v107.zip (latest zip from GitHub). Downloads since 11-11-12: undefined
  • Version 1.06, 2012-04-19, flandmark_v106.zip. Downloads since 19-04-12: undefined
  • Version 1.05, 2012-03-27, flandmark_v105.zip (NOTE: WIP, version without learning scripts). Downloads since 29-03-12: undefined
  • Version 1.04, 2012-03-01, flandmark_v104.tar
  • Version 1.03, 2011-08-30, flandmark_v103.zip
  • Version 1.02, 2011-08-10, flandmark_v102.zip

Annotated LFW database can be downloaded from here

  • lfw.tgz, direct link to the LFW database on its homepage
  • LFW_annotation.zip, LFW facial landmarks annotation (provided by courtesy of Eyedea Recognition Ltd.). Downloads since 29-03-12: undefined
  • 08-06-12 LFW annotation updated, 15 images had wrong face bounding box assigned. We would like to thanks Alberto Albiol for noticing.

Code snippets

Usage of the flandmark detector in both C/C++ and MATLAB is very simple, as you can see from the following code snippets:

MATLAB example

    % Load image and convert it to grayscaleI = rgb2gray(imread('photo.jpg'));% Get face bounding boxbbox = [72, 72, 183, 183];% Load flandmark_model file into MATLAB memorymodel = flandmark_load_model('../data/flandmark_model.dat');% Detect facial landmark calling the mex functionlandmarks = flandmark_detector(I, int32(bbox), model);

C/C++ example

   #include "flandmark_detector.h"int main(int argc, char * argv[]){// load flandmark model structure and initializeFLANDMARK_Model * model = flandmark_init("flandmark_model.dat");// load input imageIplImage *img = cvLoadImage("photo.jpg");// convert image to grayscaleIplImage *img_grayscale = cvCreateImage(cvSize(img->width, img->height), IPL_DEPTH_8U, 1);cvCvtColor(img, img_grayscale, CV_BGR2GRAY);// bbox with detected face (format: top_left_col top_left_row bottom_right_col bottom_right_row)int bbox[] = {72, 72, 183, 183};// detect facial landmarks (output are x, y coordinates of detected landmarks)float * landmarks = (float*)malloc(2*model->data.options.M*sizeof(float));flandmark_detect(img_grayscale, bbox, model, landmarks);}

Platforms

GNU/Linux, Windows

flandmark should work with Mac also, though it was not tested.

Licensing information

FLANDMARK is licensed under the GNU/GPL version 3.

References

If you use this software in research, please cite this paper [Bibtex]

  • M. Uricar, V. Franc and V. Hlavac, Detector of Facial Landmarks Learned by the Structured Output SVM, VISAPP '12: Proceedings of the 7th International Conference on Computer Vision Theory and Applications, 2012.Received Best Paper Award [pdf] [Bibtex]
  • M. Uricar, Detector of facial landmarksMaster's Thesis, supervised by V. Franc, May 2011. [pdf] [Bibtex]
  • J. Sivic, M. Everingham and A. Zisserman, "Who are you?" - Learning Person Specific Classifiers from Video, Proc. of IEEE Conference on Computer Vision and Pattern Recognition, 2009. [pdf]
  • G. B. Huang, M. Ramesh, T. Berg and E. Learned-Miller, Labeled faces in the wild: A database for studying face recognition in unconstrained environments, Technical Report 07-49. University of Massachusetts, Amherst, 2007. [pdf]

face key point with 7 points相关推荐

  1. WHAT THE DATA SAYS ABOUT KUBERNETES DEPLOYMENT PATTERNS

    2019独角兽企业重金招聘Python工程师标准>>> WHAT THE DATA SAYS ABOUT KUBERNETES DEPLOYMENT PATTERNS The con ...

  2. .ini文件的读写操作

    一·写入ini文件 1·写入字符串至ini文件 BOOL WritePrivateProfileString(   LPCTSTR lpAppName,  // pointer to section ...

  3. oracle 202,Oracle Certification 1Z0-202题库

    Oracle Other Oracle Certification 1Z0-202 考题名称:Siebel 8 Consultant Exam 版本号:V2.40 更新时间:2011-09-14 考题 ...

  4. java限频_单个用户及Ip请求频率限制思路(附java实现)

    > 我们熟悉的限流算法漏桶和令牌桶外,很多情况我们还需要考虑当个用户(ip)访问频率控制,避免被恶意调用.如果是开放平台限制一天调用多少次这种粗放的粒度相对好处理一些.如果需要更小时间粒度控制, ...

  5. c# ini file

    ini文件主要用于保存配置.之前一直以为是当作普通文本进行操作,读取里面的内容,再自己解析读取的文本.后来发现已经有写好的api函数:WritePrivateProfileString()和GetPr ...

  6. 你知道WPF这三大模板实例运用吗?

    1.介绍 对于Windows桌面端应用开发来讲,WPF以其界面渲染的特殊性,灵活的界面布局而让人津津乐道,因为它能为用户提供更好的交互体验.如何利用WPF开发出让人赏心悦目的界面与功能呢?这里不仅仅只 ...

  7. python中函数type可以测试对象类型_python类型检测最终指南--Typing模块的使用

    正文共:30429 字 预计阅读时间:76分钟 原文链接:https://realpython.com/python-type-checking/ 作者:Geir Arne Hjelle 译者:陈祥安 ...

  8. php 图表 charts

    1. phpMyGraph 官网: http://phpmygraph.abisvmm.nl/ phpMyGraph5.0.php <?php /** * Library to create s ...

  9. python typing optional_python类型检测最终指南--Typing模块的使用

    正文共:30429 字 预计阅读时间:76分钟 原文链接:https://realpython.com/python-type-checking/ 作者:Geir Arne Hjelle 译者:陈祥安 ...

最新文章

  1. python 函数递归一次增加一次变量_python3--函数(函数,全局变量和局部变量,递归函数)...
  2. c语言学习-从键盘上输入100个字符,统计其中字母、每个数字和其它字符的个数及其百分比
  3. L3-007. 天梯地图-PAT团体程序设计天梯赛GPLT
  4. 送给程序员们的经典电子书大礼包
  5. Dxg——Arduino 开发笔记整理分类合集【所有的相关记录,都整理在此】
  6. 网络盘的计算机密码,win10系统映射网络驱动器密码错误的步骤
  7. 通过WORD精灵在Word中批量添加页码,批量添加或者删除页眉页脚
  8. python将word文档转图片_如何将word文档转换为图片
  9. python人民币转大写_python实现人民币大写转换
  10. 一元稀疏多项式计算器
  11. 日常工作常用的几款小工具
  12. AndroidStudio
  13. xp桌面图标阴影解决方案
  14. 【爬虫BUG】‘list‘ object has no attribute ‘text‘
  15. 感恩工作平台心得体会_感恩工作心得体会
  16. 基于python的数据挖掘实验报告_数据挖掘实验报告一
  17. 圣思园——Java SE Lesson 2
  18. 音视频同步-ffmpeg
  19. 我国地理信息系统产业发展前景
  20. 那些有趣的网站(二)

热门文章

  1. lol服务器维护9月30,英雄联盟4月30日更新维护几点结束_4月30日LOL10.9版本停机维护结束时间_3DM网游...
  2. linux 防火墙开机启动项,Ubuntu 9.10下实现Firestarter网络防火墙自启动
  3. php 清除缓存的操作,PHP清除缓存的几种方法
  4. java定义一个指针类型变量赋值吗,C++中指针的数据类型和运算相关知识小结
  5. 如何修改python代码,如何更改默认的python版本?
  6. Java设计模式之十一 ---- 策略模式和模板方法模式
  7. 计算机动画---动画序列的设计
  8. 基于虚拟账号的邮件系统
  9. JavaScript中的工厂函数vs构造函数vs class
  10. Bridging signals(二分 二分+stl dp)