Giter VIP home page Giter VIP logo

thermal-facial-landmarks-detection's Introduction

SF-TL54: Thermal Facial Landmark Dataset with Visual Pairs

The dataset contains 2,556 thermal-visual image pairs of 142 subjects with manually annotated face bounding boxes and 54 facial landmarks. The dataset was constructed from our large-scale SpeakingFaces dataset.

Link to the paper

SF-TL54: A Thermal Facial Landmark Dataset with Visual Pairs

The facial landmarks are ordered as follows:

Download the repository:

git clone https://github.com/IS2AI/thermal-facial-landmarks-detection.git

Requirements

  • imutils
  • OpenCV
  • NumPy
  • Pandas
  • dlib
  • Tensorflow 2

To install the necessary packages properly, we ask you to walk through these two tutorials:

  1. How to install TensorFlow 2.0 on Ubuntu.
  2. Install dlib (the easy, complete guide).

Data preparation

Download the dataset from google drive.

  • Generate training, validation, and testing XML files for dlib shape predictor
python build_dlib_landmarks_xml.py --dataset dataset/ --color gray --set train
python build_dlib_landmarks_xml.py --dataset dataset/ --color gray --set val 
python build_dlib_landmarks_xml.py --dataset dataset/ --color gray --set test
  • To generate training, validation, and testing ground-truth masks for U-net, open the unet_generate_masks.ipynb notebook and run cells.

Training and testing dlib shape predictor

  • To manually tune parameters of the model:
python train_dlib_predictor.py --training dataset/gray/train/dlib_landmarks_train.xml --validation dataset/gray/val/dlib_landmarks_val.xml
  • To search optimal parameters via grid search:
python dlib_grid_search.py
  • To optimize parameters via dlib's global optimizer:
python dlib_global_optimizer.py
  • Testing the trained model:
python test_dlib_predictor.py --testing dataset/gray/test/dlib_landmarks_test.xml --model models/dlib_landmarks_predictor.dat

Training and testing the U-net model

For training and testing the U-net model, open the train_unet_predictor.ipynb notebook and run cells.

Pre-trained models

To detect faces, we trained the HOG+SVM based face detection model on our dataset. If you need more robust model then please check our TFW: Annotated Thermal Faces in the Wild project.

  1. Download the models from google drive.
  2. Put the pre-trained models inside /thermal-facial-landmarks-detection/models directory.
  3. dlib shape predictor
  • Make predictions on images:
python dlib_predict_image.py --images PATH_TO_IMAGES --models  models/ --upsample 1
  • Make predictions on a video:
python dlib_predict_video.py --input PATH_TO_VIDEO --models  models/ --upsample 1 --output output.mp4
  1. U-net model
python unet_predict_image.py --dataset dataset/gray/test --model  models/ 

For dlib face detection model (HOG + SVM)

  • Training the model:
python train_dlib_face_detector.py --training dataset/gray/train/dlib_landmarks_train.xml --validation dataset/gray/val/dlib_landmarks_val.xml
  • Make predictions on images:
python dlib_face_detector.py --images dataset/gray/test/images --detector models/dlib_face_detector.svm

To visualize dataset

  • Thermal images with bounding boxes and landmarks:
python visualize_dataset.py --dataset dataset/ --color iron --set train
  • Thermal-Visual pairs
python visualize_image_pairs.py --dataset dataset/ --color iron --set train

Video tutorials

If you use the dataset/source code/pre-trained models in your research, please cite our work:

@INPROCEEDINGS{9708901,
  author={Kuzdeuov, Askat and Koishigarina, Darina and Aubakirova, Dana and Abushakimova, Saniya and Varol, Huseyin Atakan}
  booktitle={2022 IEEE/SICE International Symposium on System Integration (SII)}, 
  title={SF-TL54: A Thermal Facial Landmark Dataset with Visual Pairs}, 
  year={2022},
  volume={},
  number={},
  pages={748-753},
  doi={10.1109/SII52469.2022.9708901}}
@Article{s21103465,
AUTHOR = {Abdrakhmanova, Madina and Kuzdeuov, Askat and Jarju, Sheikh and Khassanov, Yerbolat and Lewis, Michael and Varol, Huseyin Atakan},
TITLE = {SpeakingFaces: A Large-Scale Multimodal Dataset of Voice Commands with Visual and Thermal Video Streams},
JOURNAL = {Sensors},
VOLUME = {21},
YEAR = {2021},
NUMBER = {10},
ARTICLE-NUMBER = {3465},
URL = {https://www.mdpi.com/1424-8220/21/10/3465},
ISSN = {1424-8220},
DOI = {10.3390/s21103465}
}

thermal-facial-landmarks-detection's People

Contributors

akuzdeuov avatar kdariina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

thermal-facial-landmarks-detection's Issues

unet_mask_generation error

NameError Traceback (most recent call last)
Cell In[6], line 1
----> 1 generate_masks('dataset/gray/train/json')
2 generate_masks('dataset/gray/val/json')
3 generate_masks('dataset/gray/test/json')

Cell In[5], line 32, in generate_masks(jsonFolder)
29 info = "{}{}{}".format(sub_id, trial_id, pos_id)
31 # if image is challenging, skip it
---> 32 df = pd.read_csv(os.path.join(datasetPath, "challenging_images.csv"))
34 if ((df['sub_id'] == int(sub_id)) & (df['trial_id'] == int(trial_id)) & (df['pos_id'] == int(pos_id))).any():
35 print('Excluding: ', info)

NameError: name 'datasetPath' is not defined
can you please tell how to solve this , if i am replacing this with absolute path then there is other error

About SpeakingFaces

Hi. I noticed that this dataset is constructed from SpeakingFace. How to download the original SpeakingFace dataset? I sent the form as you requested, but have not received any respons. This dataset is constructed from SpeakingFace. How to download the original SpeakingFace dataset? I sent the form as you requested, but have not received any response to download the instructions. Hope to see your reply soon.e to download the instructions. Hope to see your reply soon.

Help needed regarding error

thermal-facial-landmarks-detection> python train_dlib_predictor.py --training dataset/gray/train/dlib_landmarks_train.xml --validation dataset/gray/val/dlib_landmarks_val.xml
[INFO] setting shape predictor options...
[INFO] shape predictor options:
shape_predictor_training_options(be_verbose=1, cascade_depth=20, tree_depth=4, num_trees_per_cascade_level=500, nu=0.01, oversampling_amount=20, oversampling_translation_jitter=0.1, feature_pool_size=750, lambda_param=0.1, num_test_splits=100, feature_pool_region_padding=0, random_seed=, num_threads=4, landmark_relative_padding_mode=1)
[INFO] training shape predictor...
Traceback (most recent call last):
File "train_dlib_predictor.py", line 79, in
dlib.train_shape_predictor(args["training"],
RuntimeError: Error, the training dataset does not have any labeled object detections in it.
Can you please suggest ways to fix this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.