% =========================================================================
%                 TCDCN face alignment tool (68 points)
% =========================================================================
% The provided tool is a re-implementation of the papers:
% 
% [1] Zhanpeng Zhang, Ping Luo, Chen Change Loy, Xiaoou Tang. Facial Landmark Detection 
%     by Deep Multi-task Learning, in Proceedings of European Conference on Computer Vision (ECCV), 2014
% 
% [2] Zhanpeng Zhang, Ping Luo, Chen Change Loy, Xiaoou Tang. Learning Deep Representation for Face Alignment  
%     with Auxiliary Attributes. Technical report, arXiv:1408.3967v2, 2014.
% =========================================================================
% Prerequisites:
% 1. Piotr's Computer Vision Matlab Toolbox (http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html,
%                                            https://github.com/pdollar/toolbox)
%
%Usuage:
% 
% IN:
% - "listFileName " is a file that contains the images to be tested. 
% OUT:
% - "outputFileName" a file that will be generated by this tool and records the computed facial landmark locations.  
% =========================================================================
% Format:
% 
% Format of the listfile:
% Each of  line contains the image path, followed by the left, top, width and height of the face bounding boxe.
% (see the example file "list.txt" in the package and "boundingbox.jpg" illusrates how large the bounding box should be.)
% 
% Format of the outputFile:
% Each line contrains input image path followed by the 68 facial landmark locations (x1,y1,x2,y2....x68,y68).
% To view the format of the output file, see visualize.m.
% Notice
% 1) This demo has been tested on Windows 7 64 bit, Matlab 2013a.
% 
% *More details of our implementation, please feel free to drop me an email, zhzhanp@gmail.com.
% =========================================================================


clear; clc;
addpath('./TCDCN/');

%% paramter setup
listFileName = 'list.txt';
modelFile = 'model.mat';
outputFileName = 'output.txt';

%% run
main(listFileName,modelFile,outputFileName)