Professional Documents
Culture Documents
Face Landmark Detection Demo Tutorial
Face Landmark Detection Demo Tutorial
http://dlib.net/files/data/ibug_300W_large_face_landmark_dataset.tar.gz
The file is 1.8G, will take a few mins, you can download the file to the ML folder, then
unzip it to your CNNTraining folder. The unzipped directory has 4 sub-directories, each
one has a training dataset and 4 in total. Meanwhile there are 3 files with xml extension
type.
Step 4: set training options, in a terminal, do following (>> means the system output)
ipython
mod= dlib.shape_predictor_training_options()
type(mod)
>>dlib.shape_predictor_training_options
print("[INFO] setting shape predictor options...")
>>[INFO] setting shape predictor options...
mod = dlib.shape_predictor_training_options()
mod.tree_depth = 4
mod.nu = 0.1
mod.cascade_depth = 15
mod.feature_pool_size = 400
mod.num_test_splits = 50
mod.oversampling_amount = 5
mod.oversampling_translation_jitter = 0.1
mod.be_verbose = True
import multiprocessing
mod.num_threads = multiprocessing.cpu_count()
print("[INFO] shape predictor options:")
>>[INFO] shape predictor options:
print(mod)
>>shape_predictor_training_options(be_verbose=1, cascade_depth=15, tree_depth=4,
num_trees_per_cascade_level=500, nu=0.1, oversampling_amount=5,
oversampling_translation_jitter=0.1, feature_pool_size=400, lambda_param=0.1,
num_test_splits=50, feature_pool_region_padding=0, random_seed=, num_threads=0,
landmark_relative_padding_mode=1)
dlib.train_shape_predictor(“labels_ibug_300W_train.xml”,”face-68.dat”,mod)
Exit ipython by
exit()
ls -l
Step 8: run the demo: copy and paste the python code ‘predictor.py’ in the working
directory CNNTraining, then open a terminal and cd to CNNTraining, run following