Predicting-Student-Attentiveness-using-OpenCV
The model will predict if a student is attentive or not through facial parameter received through the student's webcam using Face Detection, Drowsiness Detection, and Head Pose Estimation
Libraries Used (To be installed to execute program)
Information :
-
data : The data folder contains test images for cam_calibration.py and a '.dat' file used for placing landmarks on the face using dlib library.
-
face detectors : This folder contains two face detector models that were used to implement Drowsiness Detection and Head Pose Estimation.
-
helpermod : This folder contains two helper modules used for implementing Head Pose Estimation.
-
Drowsiness_Detection.py : The main program for implementing Drowsiness Detection to predict Student Attentiveness.
-
cam_calibration.py : This program is to be run before running headposedlib.py to implement Head Pose Estimation correctly.
-
headposedlib.py : This contains the main program for implementing Head Pose Estimation to predict Student Attentiveness.
Steps to run the Program :
- Install all the required library packages in your python environment.
- Drowsiness_Detection.py can then be run. A new window will popup with the webcamera turning on and the video will displayed on this window. The program will detect face and check if the eyes are opened or closed to predict if the student is attentive or not attentive. To exit the program , press the ESC key.
- Run cam_calibration.py, this will give the approximate focal length as output. This focal length has to be modified in the headposedlib.py for correct implementation.
- In headposedlib.py, modify the focal length 'f' to the nearest intger value received as output of the cam_calibration.py program.
- After updating the focal length 'f', run headposedlib.py. A new window will popup with the webcamera turning on and the video will displayed on this window.The program will estimate the position of the head to predict if the student is attentive or not attentive. To exit the program, press the ESC key.
Note : The face detector models used to run Drowsiness_Detection.py and headposedlib.py are given for reference.
Both these programs can be run after the required libraries are installed. Both these programs will open a new window with your video capture through the webcam and will detect the face on the video. To exit these programs, press the ESC key.
Project Done By
Johann Kyle Pinto
Reg No. : 20BKT0009