CoolFace
Apppublic

pgoel90/Palm-Rehabilitation-Trainer

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Hand Rehabilitation System

An intelligent hand rehabilitation system that uses computer vision and machine learning to provide real-time feedback on hand exercises. This system helps patients perform rehabilitation exercises correctly with instant feedback on their form and technique.

Features

  • —Real-time Hand Detection: Uses MediaPipe for accurate hand landmark detection
  • —Exercise Classification: Machine learning model trained to recognize 8 different hand exercises
  • —Instant Feedback: Provides real-time feedback on exercise form and technique
  • —Reference Images: Shows proper form for each exercise
  • —Multiple Exercise Support: Supports 8 different rehabilitation exercises

Supported Exercises

  1. 1.Ball Grip (Wrist Down): Squeeze a ball with wrist positioned down
  2. 2.Ball Grip (Wrist Up): Squeeze a ball with wrist positioned up
  3. 3.Pinch: Bring thumb and index finger together in a pinching motion
  4. 4.Thumb Extend: Extend thumb while keeping other fingers in position
  5. 5.Opposition: Touch thumb to each finger tip sequentially
  6. 6.Extend Out: Extend all fingers outward
  7. 7.Finger Bend: Bend all fingers inward
  8. 8.Side Squeezer: Squeeze between index and middle fingers

Technology Stack

  • —Frontend: Streamlit
  • —Computer Vision: OpenCV, MediaPipe
  • —Machine Learning: Scikit-learn, Random Forest Classifier
  • —Image Processing: PIL (Pillow)
  • —Data Handling: Pandas, NumPy

How to Use

  1. 1.Position Your Hand: Place your hand in front of the camera with good lighting
  2. 2.Start Detection: Check the "Run Hand Detection" box
  3. 3.Perform Exercises: Follow the reference images and perform the exercises
  4. 4.Get Feedback: View real-time feedback on your form and technique
  5. 5.Switch Exercises: The system automatically detects and switches between exercises

Model Information

  • —Algorithm: Random Forest Classifier
  • —Features: Hand landmark distances and angles (42 features)
  • —Training Data: Hand landmark data from various exercise positions
  • —Accuracy: Model provides real-time classification with confidence scores

File Structure

Palm-Rehabilitation-Trainer/
├── app.py                 # Main Streamlit application
├── requirements.txt       # Python dependencies
├── Dockerfile            # Container configuration
├── README.md             # Project documentation
└── src/                  # Source code modules
    ├── models/           # Machine learning models
    ├── feedback/         # Exercise feedback functions
    └── utils/            # Utility functions

Setup and Installation

  1. 1.Clone the repository
  2. 2.Install dependencies: pip install -r requirements.txt
  3. 3.Run the application: streamlit run app.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Support

For support and questions, please open an issue on the GitHub repository.


Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference