https://github.com/rsemihkoca/postrue
Postrue is a Python-based application that empowers users to enhance their posture in real-time by detecting and correcting incorrect postures using Mediapipe and OpenCV libraries.
https://github.com/rsemihkoca/postrue
computer-vision mediapipe opencv pose pose-detection posture posture-recognition python
Last synced: about 1 month ago
JSON representation
Postrue is a Python-based application that empowers users to enhance their posture in real-time by detecting and correcting incorrect postures using Mediapipe and OpenCV libraries.
- Host: GitHub
- URL: https://github.com/rsemihkoca/postrue
- Owner: rsemihkoca
- License: apache-2.0
- Created: 2023-09-09T17:41:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T13:20:17.000Z (over 2 years ago)
- Last Synced: 2025-02-14T15:49:56.171Z (over 1 year ago)
- Topics: computer-vision, mediapipe, opencv, pose, pose-detection, posture, posture-recognition, python
- Language: Python
- Homepage:
- Size: 3.46 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postrue: Correcting Body Posture and Data Collection
Postrue is a Python-based application that helps users improve their body posture by providing real-time feedback and warnings about incorrect postures. Additionally, it collects valuable posture data for further analysis, which is stored in a PostgreSQL database.
## Features
- **Real-time Posture Correction**: Postrue utilizes the Mediapipe and OpenCV libraries to detect the user's body posture in real-time. It provides warnings and guidance to help users maintain correct postures.
- **Data Collection**: The application offers three different data retrieval endpoints: `GET /daily/`, `GET /weekly/`, and `GET /monthly/`. Users can access their posture data on a daily, weekly, or monthly basis, allowing them to track their progress over time.
- **Database Storage**: All collected posture data is securely stored in a PostgreSQL database, ensuring that users can review their historical posture information and gain insights into their posture improvement journey.
## Technology Stack
- **Language**: Python
- **Libraries**:
- Mediapipe and OpenCV for real-time posture detection.
- FastAPI for creating the API endpoints.
- SQLAlchemy for interacting with the PostgreSQL database.
## Live Demo
Check out the live demo of Postrue in action: [Watch Demo](https://www.youtube.com/watch?v=PwMzpxKCctk&ab_channel=R%C4%B1zaSemihKoca)
## Screenshots





## Getting Started
To set up and run docker-compose, follow these steps:
1. Clone the repository.
2. Create a `.env` file in the `backend` directory and add the following environment variables(Values can be changed as needed):
```
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=postgres
POSTGRES_HOST=127.0.0.1
POSTGRESQL_CON_STR=postgresql+psycopg2://postgres:postgres@127.0.0.1:5432/postgres
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=admin
```
3. Run `docker-compose up --build` to build the images and start the containers.
4. Navigate to `http://localhost:8000/docs` to access the Swagger UI and test the API endpoints.
5. Navigate to `http://localhost:8081` to access the pgAdmin dashboard and view the database.
## Usage
1. Start the application and allow access to your camera for real-time posture detection.
2. Maintain correct posture, and Postrue will provide feedback and warnings if any incorrect postures are detected.
3. Use the data retrieval endpoints (`GET /daily/`, `GET /weekly/`, and `GET /monthly/`) to track your posture improvement progress.
## Contribution
We welcome contributions from the open-source community to make Postrue even better. Feel free to create issues, submit pull requests, or provide feedback.
## License
This project is licensed under the [MIT License](LICENSE).
## Acknowledgments
- Special thanks to
- @rabiaelifcelik for the logo design.
- @bunyaminkorkut for the analytics design and application.
- @feyyum for the frontend application.
Improve your posture with Postrue, and start your journey towards better health and well-being!