This web application estimates heart rate and measures stress levels using physiological signals extracted from uploaded video files. It utilizes Python Flask as the backend framework and HTML/JavaScript for the frontend user interface.
- Clone the repository to your local machine:
git clone https://github.com/itz-salemm/BeatPal.git
- Install the required Python packages using pip:
pip install -r requirements.txt
- Set up environment variables for Firebase authentication. You can create a
.env
file in your project directory and add the following configuration:
FIREBASE_API_KEY=your_api_key
FIREBASE_AUTH_DOMAIN=your_auth_domain
FIREBASE_STORAGE_BUCKET=your_storage_bucket
- Run the Flask web server:
python app.py
-
Open your web browser and navigate to http://localhost:5000/estimate.
-
Upload a video file containing the subject's facial region.
-
Click the "Estimate Heart Rate" button.
-
The estimated heart rate and stress level will be displayed on the webpage.
- Heart Rate Estimation: The application calculates the heart rate of the subject by analyzing the facial region in the uploaded video.
- Stress Level Measurement: In addition to heart rate estimation, the application measures stress levels using heart rate variability (HRV) as an indicator.
- User-friendly Interface: The web interface allows users to easily upload video files and view the results.
The project consists of the following components:
app.py
: The main Flask application file that defines routes and handles requests.templates/index.html
: The HTML template for the user interface, including the file upload form and result display.pulse_tracker.py
: The Python module containing thePulse
class for heart rate estimation and stress level measurement.
- Flask: Lightweight web framework for Python.
- OpenCV: Library for computer vision tasks, used for video processing.
- NumPy: Library for numerical computations.
- SciPy: Library for scientific computing.
- Pyrebase: Python wrapper for Firebase, used for storage access (if applicable).