[IMPORTANT UPDATE ]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

This is a C++/C and CUDA version of DRMF face tracking, the program utilizes opencv 2.4.5 and CUDA (with capability of 2.0 or higher), and some of the codes are inherited from Jason Saragih's facetracker implementation. This version of code works for common image format (jpg,bmp,png ...). The program accept the face image and perform fitting, after that it returns the estimated pose, 66 facial points coordinates(stored in the corresponding '[image_name]_pose_pts.txt' file). 

The folder contains: 'model' folder which holds the necessary models for the fitting, 'images' folder which contains some samples inputs. 

Note that this program is compiled on Ubuntu 12.04 LTS. 

# 
# Usage: ./FitCuda_DRMF_Linux_v2.3 [options]
#

Note: To see the argument list, you can type 'FitCuda_DRMF_Linux_v2.3 --help' in your command window.

Arguments:
	
-mode <int> -> Single or Multiple Image Input(1 - Single; 2 - Multiple(A folder of images)) (default: 1).

-p <string> -> The working path of *.exe file. For example '/data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3'.

-save <int> -> Save which shape (1 - 2D shape; 2 - 3D shape; 3 - Both) (default: 1).

-track <int> -> Whether to use tracking(0 - Not use; 1 - Use) (default: 0). The tracking is basically frame-to-frame tracking, we use the information of previous frame to initialize next frame.

-i <string> -> Source Image. For Single mode, input name; for Multiple mode, input a folder
(default: [working path]/images/1.jpg)

-o <string> -> Output Points file. For Single mode, input name; for Multiple mode, input a folder
(default: [working path]/points/1_pose_pts.txt)

-w <int> -> Search Window Size (default: 41)


# 
# Example commands:
# 

Under Linux terminal, firstly direct to the place where FitCuda_DRMF_Linux_v2.3.exe file is in.

1. Fit one image, save both 2D and 3D shape, others are default. (Txt filename would be '1_pose_pts.txt')

  ./FitCuda_DRMF_Linux_v2.3 -mode 1 -save 3 -p /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3 -i /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/images/1.jpg -o /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/points/1_pose_pts.txt

2. Fit a folder of images, save only 2D shape, others are default. (Each output face's (orig cut) name will be '[filename]_cut.[corresponding type]', the clean cut will be '[filename]_clean_cut.[corresponding type]'. Txt files are '[filename]_pose_pts.txt', and it is saved in the same folder with original cut images!)

  ./FitCuda_DRMF_Linux_v2.3 -mode 2 -save 1 -p /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3 -i /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/images -o /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/points

3. Track (use the 'track' option) a folder of images, save only 2D shape, others are default. (Each output Txt file is  '[filename]_pose_pts.txt')

  ./FitCuda_DRMF_Linux_v2.3 -mode 2 -track 1 -save 1 -p /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3 -i /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/images -o /data/RA/Demos/FitCuda_DRMF_Linux_exe_v2.3/points


Should you have any other problems, please contact me (sc6510@imperial.ac.uk) directly.


Cheers,
Shiyang
