Intro to Dlib
Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems.
It is used in both industry and academia in a wide range of domains including robotics, embedded devices, mobile phones, and large high performance computing environments.
Dlib's open source licensing allows you to use it in any application, free of charge.
We will be using Dlib library though python.
Major Features
- Documentation
- High Quality Portable Code
- Machine Learning Algorithms
- Numerical Algorithms
- Graphical Model Inference Algorithms
- Image Processing
- Threading
- Networking
- Graphical User Interfaces
- Data Compression and Integrity Algorithms
- Testing
- General Utilities
Popular Dlib Models
- dlib_face_recognition_resnet_model_v1.dat : This model is a ResNet network with 29 conv layers.
It's essentially a version of the ResNet-34 network from the paper Deep Residual Learning for Image Recognition by He, Zhang, Ren, and Sun with a few layers removed and the number of filters per layer reduced by half.
The network was trained from scratch on a dataset of about 3 million faces.
- mmod_dog_hipsterizer.dat : This dataset is trained on the data from the Columbia Dogs dataset.
- mmod_human_face_detector.dat : They created the dataset by finding face images in many publicly available image datasets (excluding the FDDB dataset).
In particular, there are images from ImageNet, AFLW, Pascal VOC, the VGG dataset, WIDER, and face scrub.
- resnet34_1000_imagenet_classifier.dnn : This is trained on the venerable ImageNet dataset.
- shape_predictor_5_face_landmarks.dat : This is a 5 point landmarking model which identifies the corners of the eyes and bottom of the nose. It is trained on the dlib 5-point face landmark dataset, which consists of 7198 faces.
I created this dataset by downloading images from the internet and annotating them with dlib's imglab tool.
- shape_predictor_68_face_landmarks.dat : The license for this dataset excludes commercial use and Stefanos Zafeiriou, one of the creators of the dataset, asked me to include a note here saying that the trained model therefore can't be used in a commerical product. So you should contact a lawyer or talk to Imperial College London to find out if it's OK for you to use this model in a commercial product.
Also note that this model file is designed for use with dlib's HOG face detector. That is, it expects the bounding boxes from the face detector to be aligned a certain way, the way dlib's HOG face detector does it. It won't work as well when used with a face detector that produces differently aligned boxes, such as the CNN based mmod_human_face_detector.dat face detector.
- mmod_rear_end_vehicle_detector.dat : This model is trained on the dlib rear end vehicles dataset. The dataset contains images from vehicle dashcams which they manually annotated using dlib's imglab tool.
- mmod_front_and_rear_end_vehicle_detector.dat : This model is trained on the dlib front and rear end vehicles dataset. The dataset contains images from vehicle dashcams which I manually annotated using dlib's imglab tool.