Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Work-from-Home Productivity & Posture Assessment Tool

This project is a prototype computer-vision system designed to assess user posture and activity in a work-from-home setting using real-time webcam input. The system leverages skeletal landmark data extracted from video frames to train a supervised machine learning model capable of classifying posture & attentiveness in real time.

The primary goal of the project was to explore how pose estimation and spatial features can be used to build lightweight posture-awareness tools using off-the-shelf computer vision and machine learning libraries.


Overview

The system follows a simple pipeline:

  1. Capture webcam video using OpenCV
  2. Extract skeletal landmarks using MediaPipe Holistic
  3. Store per-frame spatial coordinate data for labeled posture samples
  4. Train a supervised ML classifier on the collected data
  5. Run real-time inference and visualize predictions on live video

This project was developed as a proof-of-concept rather than a production-ready application.


Key Features

  • Real-time webcam-based posture analysis
  • Skeletal landmark extraction (pose, face, and hands)
  • Dataset generation from spatial coordinate features
  • Supervised ML training and evaluation using scikit-learn
  • Real-time inference with on-screen visualization
  • Model persistence using Pickle

Technologies Used

  • Python
  • MediaPipe (Holistic pose estimation)
  • OpenCV (video capture and visualization)
  • NumPy / Pandas (data handling)
  • scikit-learn (model training and evaluation)
  • Pickle (model serialization)

Data Collection

Training data is generated by capturing webcam frames and extracting skeletal landmark coordinates for each frame. Each frame produces a flattened vector of spatial features representing the user’s posture at that moment.

Data collection is performed in multiple sessions and labeled by posture category (e.g., good posture, slouching, leaning forward). Aggregating these sessions results in a dataset containing thousands of labeled spatial coordinate samples.


Model Training

The collected dataset is used to train a supervised machine learning classifier using a scikit-learn pipeline. The pipeline includes feature scaling and model fitting, with multiple algorithms evaluated during experimentation.

After training, the selected model is serialized using Pickle for reuse during real-time inference.


Real-Time Inference

During inference, the trained model is loaded and applied to live webcam input. Skeletal landmarks are extracted frame-by-frame, passed through the trained classifier, and the predicted posture class is displayed directly on the video feed.

This allows for immediate feedback and qualitative evaluation of the model’s performance.


Project Structure

Additional files such as datasets (.csv) and serialized models (.pkl) are generated during execution and are not required to understand the core logic of the project.


Notes & Limitations

  • This project is a prototype and was not optimized for deployment or long-term use.
  • Model performance depends heavily on lighting conditions, camera angle, and labeling consistency.
  • Pickle files should only be loaded from trusted sources.
  • The system assumes a relatively fixed camera position and user orientation.

Future Improvements

Potential extensions to this project include:

  • More granular posture and activity classes
  • Automated posture feedback or alerts
  • Temporal modeling using sequential data
  • Improved dataset balancing and evaluation metrics
  • Conversion from notebook prototype to modular application

Disclaimer

This project was created for exploratory purposes to demonstrate the application of computer vision and machine learning techniques to posture analysis.

About

Computer vision posture assessment tool using MediaPipe skeletal landmarks and supervised machine learning with real-time inference.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages