Skip to main content

AI Posture Monitor

This project introduces an innovative, cost-effective solution for real-time activity monitoring of elderly individuals. By leveraging the MediaPipe pose estimation model, fuzzy logic, and finite state machines, the system can reliably track individuals, recognize static postures (standing, sitting, lying), and detect transitions, particularly focusing on falls.

Source code: https://github.com/pat2echo/AI-Posture-Monitor
Dataset (CC BY 4.0): https://www.kaggle.com/datasets/patrickogbuitepu/posture-monitor-and-fall-detection
Demo notebook on Kaggle: https://www.kaggle.com/code/patrickogbuitepu/fall-detection-posture-classification-starter

Requirements

Python 3.9 - 3.12 (mediapipe, the pose-estimation dependency, ships no wheels for 3.13+ in the supported version range).

Supported environments: local CLI/Jupyter and Kaggle notebooks. Google Colab is not officially supported (its runtime preloads libraries that conflict with mediapipe's pinned dependencies).

Quickstart

Set up a virtual environment and install:

# Linux / macOS / WSL (use python3.12/3.11/3.10 if your default python3 is 3.13+):
python3.12 -m venv .venv && source .venv/bin/activate
pip install ai-posture-monitor kagglehub
# Windows:
py -3.12 -m venv .venv && .venv\Scripts\activate
pip install ai-posture-monitor kagglehub

Classify a static pose in a few lines (fetches a sample image from the public Kaggle dataset - no Kaggle account needed):

import kagglehub
import ai_posture_monitor as pm

img = kagglehub.dataset_download(
    'patrickogbuitepu/posture-monitor-and-fall-detection', path='train/pose/stand.jpg')

pose, mp_drawing, mp_pose = pm.initialize_mediapipe()
results, img_rgb, landmarks = pm.detect_pose_landmarks(img, pose=pose, show=True)
print(pm.get_features(landmarks[['X', 'Y', 'Z']].to_numpy(), image_name='stand.jpg'))
# -> ['stand.jpg', True, 59, 'standing', 'standing', 82, 86, 'non_sitting', ...]

CLI demo

A ready-made command-line demo (prints a stand/sit/lie verdict table and saves landmark-annotated images) lives in the repository:

git clone https://github.com/pat2echo/AI-Posture-Monitor
python AI-Posture-Monitor/examples/cli_demo.py                  # 3 sample images from the dataset
python AI-Posture-Monitor/examples/cli_demo.py --images my.jpg  # your own photos

Try it on Kaggle (zero setup)

Open the demo notebook and click "Copy & Edit": https://www.kaggle.com/code/patrickogbuitepu/fall-detection-posture-classification-starter

Fall detection on video

import ai_posture_monitor as pm

pe = pm.PoseEstimation()
pe.process_video(video_file='my_video.mp4', plot_results=True)                      # fall detection
pe.process_video(video_file='my_video.mp4', plot_results=True, predict_fall=False)  # posture only

Features

  • Real-Time Activity Monitoring: Tracks and analyzes movements continuously.
  • Pose Detection: Identifies key postures: standing, sitting, and lying down.
  • Fall Detection: Detects falls with minimal false alarms.
  • Fuzzy Logic Analysis: Utilizes fuzzy logic for accurate movement interpretation.
  • User-Centric Design: Tailored for elderly individuals living alone.
  • Environmental Adaptability: Functions effectively in well-lit indoor settings.
  • Scalable and Cost-Effective: Affordable solution for diverse applications.

Metadata

Release files for ai-posture-monitor 0.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-posture-monitor 0.0.22
File Size Uploaded Provenance Actions
ai_posture_monitor-0.0.22.tar.gz 35.7 kB Without provenance Details for ai_posture_monitor-0.0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-posture-monitor 0.0.22
File Interpreter ABI Platform Actions
ai_posture_monitor-0.0.22-py3-none-any.whl Python 3 none any Details for ai_posture_monitor-0.0.22-py3-none-any.whl

Total release size: 71.3 kB

Release files / ai_posture_monitor-0.0.22.tar.gz

Download URL ai_posture_monitor-0.0.22.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5188a192d6ea624bfdf0ca4949ac72c84bbcec230b87ebcc3c63d5a7ef05879
BLAKE2b-256 checksum
How to use checksums
8ba22186d89f93298c8f3581fe738371a6f5c43443716409970f2e00d27744ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / ai_posture_monitor-0.0.22-py3-none-any.whl

Download URL ai_posture_monitor-0.0.22-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67425429b52e67fb8fbf1dd70495c94c4b6ea77fe93bb013e0039cf803a7f55c
BLAKE2b-256 checksum
How to use checksums
d38e3b418300f9164203546962fd4a03b0ad1fcf0111e650ac0d670f89e679bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for ai-posture-monitor 0.0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.22 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page