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.
-
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/
, andGET /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.
- Language: Python
- Libraries:
- Mediapipe and OpenCV for real-time posture detection.
- FastAPI for creating the API endpoints.
- SQLAlchemy for interacting with the PostgreSQL database.
Check out the live demo of Postrue in action: Watch Demo
To set up and run docker-compose, follow these steps:
- Clone the repository.
- Create a
.env
file in thebackend
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
- Run
docker-compose up --build
to build the images and start the containers. - Navigate to
http://localhost:8000/docs
to access the Swagger UI and test the API endpoints. - Navigate to
http://localhost:8081
to access the pgAdmin dashboard and view the database.
- Start the application and allow access to your camera for real-time posture detection.
- Maintain correct posture, and Postrue will provide feedback and warnings if any incorrect postures are detected.
- Use the data retrieval endpoints (
GET /daily/
,GET /weekly/
, andGET /monthly/
) to track your posture improvement progress.
We welcome contributions from the open-source community to make Postrue even better. Feel free to create issues, submit pull requests, or provide feedback.
This project is licensed under the MIT License.
- 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!