|
a |
|
b/README.md |
|
|
1 |
## Facial Stress Detection using Thermal Imaging |
|
|
2 |
|
|
|
3 |
### Project Description |
|
|
4 |
* Accurate detection of mental health diseases is achieved by generating a body heat map of the patient using a thermal camera and applying techniques of image processing and Deep Learning image classification models to measure the disease's magnitude. |
|
|
5 |
* Working photos/videos [here](https://github.com/Sai-Adarsh/ThermalAI/tree/master/WorkingPhotos) |
|
|
6 |
* Know more about Problem & Solution [here](https://github.com/Sai-Adarsh/ThermalAI/blob/master/Phase1/Team%20Appendly%20-%20Shaastra%20AI%20Challenge%202018%20Phase%20I%20Ideation.pdf) |
|
|
7 |
|
|
|
8 |
### Dataset |
|
|
9 |
* [Dataset - Visual Computing and Image Processing Lab |
|
|
10 |
Oklahoma State University](http://vcipl-okstate.org/pbvs/bench/Data/04/download.html) |
|
|
11 |
* [Sample Dataset - Visual Computing and Image Processing Lab |
|
|
12 |
Oklahoma State University](http://vcipl-okstate.org/pbvs/bench/Data/04/face01.zip) |
|
|
13 |
|
|
|
14 |
## Getting Started |
|
|
15 |
|
|
|
16 |
### Run: |
|
|
17 |
```bash |
|
|
18 |
$ git clone https://github.com/Sai-Adarsh/facial-stress-using-thermal-image.git |
|
|
19 |
|
|
|
20 |
$ cd facial-stress-using-thermal-image |
|
|
21 |
|
|
|
22 |
$ pip install -r requirements.txt |
|
|
23 |
``` |
|
|
24 |
### Open and replace the project path with the respective path inside the below mentioned files: |
|
|
25 |
```bash |
|
|
26 |
project\thermalai\predictor\predict.py |
|
|
27 |
|
|
|
28 |
tutorial-2-image-classifier\predict.py |
|
|
29 |
|
|
|
30 |
tutorial-2-image-classifier\train.py |
|
|
31 |
``` |
|
|
32 |
|
|
|
33 |
### Activate virtualenv |
|
|
34 |
```bash |
|
|
35 |
# Linux |
|
|
36 |
$ source ./venv/bin/activate |
|
|
37 |
|
|
|
38 |
# Windows |
|
|
39 |
$ cd venv/Scripts/ |
|
|
40 |
|
|
|
41 |
$ activate |
|
|
42 |
``` |
|
|
43 |
### Train/Test |
|
|
44 |
Place your thermal dataset in the training_data and testing_data folders. |
|
|
45 |
|
|
|
46 |
```bash |
|
|
47 |
$ cd tutorial-2-image-classifier |
|
|
48 |
|
|
|
49 |
$ python train.py |
|
|
50 |
``` |
|
|
51 |
|
|
|
52 |
### Predict |
|
|
53 |
```bash |
|
|
54 |
$ cd tutorial-2-image-classifier |
|
|
55 |
|
|
|
56 |
$ python predict.py sample.jpg (any extension works) |
|
|
57 |
``` |
|
|
58 |
### Run web app: |
|
|
59 |
```bash |
|
|
60 |
$ cd project\thermalai |
|
|
61 |
|
|
|
62 |
$ python manage.py runserver |
|
|
63 |
``` |
|
|
64 |
### Run through Raspberry Pi (with a camera): |
|
|
65 |
Open a new CMD terminal (Ensure that Raspbian OS is installed on the Raspberry Pi). |
|
|
66 |
```bash |
|
|
67 |
$ cd project\thermalai\thermalai |
|
|
68 |
|
|
|
69 |
# Add the desired host and its ports to the ALLOWED_HOSTS section of settings.py |
|
|
70 |
$ cd project\thermalai |
|
|
71 |
|
|
|
72 |
$ python manage.py runserver |
|
|
73 |
|
|
|
74 |
$ cd RaspberryPi |
|
|
75 |
|
|
|
76 |
# Windows |
|
|
77 |
$ runthisstress.sh |
|
|
78 |
|
|
|
79 |
# Linux |
|
|
80 |
$ ./runthisstress.sh |
|
|
81 |
``` |
|
|
82 |
### References |
|
|
83 |
* [Facial Thermal Image Analysis for Stress Detection](https://www.semanticscholar.org/paper/Facial-Thermal-Image-Analysis-for-Stress-Detection-Hong-Liu/2e8ccf7156629bcf14d43b946397eb04a14b9d78) |
|
|
84 |
* [Stress as a Mediator of Socioeconomic Disparities in Health: The Role of Race](http://www.pnas.org/content/pnas/suppl/2013/12/26/1321664111.DCSupplemental/pnas.201321664SI.pdf) |
|
|
85 |
* [Indians Suffer from Stress and Depression](https://www.businesstoday.in/lifestyle/off-track/indians-suffer-from-stress-depression/story/280119.html) |
|
|
86 |
* [89% of India's Population Suffers from Stress; Most Don't Feel Comfortable Talking to Medical Professionals](https://economictimes.indiatimes.com/magazines/panache/89-per-cent-of-indias-population-suffering-from-stress-most-dont-feel-comfortable-talking-to-medical-professionals/articleshow/64926633.cms) |
|
|
87 |
* [Mental Health Statistics - Stress](https://www.mentalhealth.org.uk/statistics/mental-health-statistics-stress) |
|
|
88 |
* [ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3968009/) |
|
|
89 |
* [journals.plos.org](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0090782) |
|
|
90 |
* [Modeling Stress Using Thermal Facial Patterns: A Spatio-Temporal Approach](https://www.researchgate.net/publication/261206963_Modeling_Stress_Using_Thermal_Facial_Patterns_A_Spatio-Temporal_Approach) |