This Python script uses OpenCV and MediaPipe to estimate head pose in real-time from a webcam feed. It detects facial landmarks and calculates the head's rotation angles, which can be used to determine if the person is looking left, right, up, down, or straight.
- Requirements
- Installation
- Usage
- Output
To run this code, you need the following libraries and dependencies:
- Python 3.x
- OpenCV (cv2)
- MediaPipe
- NumPy
- Pandas
- You can install the required Python libraries using pip and requirements.txt
pip install -r requirements.txt
- Clone this repository or download the script to your local machine.
git clone https://github.com/Manoj-2702/FacialAnalysis-IISc.git
- Navigate to the project directory.
cd FacialAnalysis-IISc/FaceAnalysis
- Run the script
python main2.py
-
Execute the script as mentioned in the Installation section.
-
A webcam feed will open, and the application will estimate the user's head pose in real-time.
-
The script will display the direction in which the head is tilted, such as looking left, right, up, down, or straight.
-
Press 'q' to exit the application.
The script will display the webcam feed with head pose estimation, and it will print the following information to the console:
- The direction in which the user is looking.
- The rotation angles (X and Y) of the head.
- The percentages of time spent looking in each direction over the entire session.
This script uses the pyannote library to perform speaker verification on audio samples. It extracts speaker embeddings using a pretrained model and compares them to determine if the speakers are the same or different.
- Python 3.x
- PyTorch
- Pyannote.audio
- Scipy
- You can install the required libraries using pip and requirements.txt
pip install -r requirements.txt
- Clone this repository or download the script to your local machine.
git clone https://github.com/Manoj-2702/FacialAnalysis-IISc.git
- Navigate to the project directory.
cd FacialAnalysis-IISc/Speaker_Verification
- Run the script
python speaker_verification.py
sample_rate
: The sample rate of the audio. Defaults to 16000.mono
: Set to "downmix" to convert stereo to mono.distance
: The threshold for cosine distance. Adjust this value based on your requirements. Default is 0.4.