Spaces:
Sleeping
Sleeping
| title: Yoga Pose Classifier | |
| emoji: π’ | |
| colorFrom: blue | |
| colorTo: yellow | |
| sdk: docker | |
| pinned: false | |
| short_description: Add end-to-end yoga pose classification system with DenseNet | |
| # Yoga Pose Classification β Deep Learning Web Application | |
| ## Overview | |
| This project presents an **end-to-end Yoga Pose Classification system** that integrates **Deep Learning (DenseNet121)** with a **Flask-based web application**. Users can upload an image of a yoga pose and obtain the predicted pose along with confidence scores. | |
| The project follows **industry best practices**, including modular code structure, clean separation of concerns, and deployment-ready architecture. It is suitable for **portfolio presentation**, **internship submissions**, and **real-world AI application demos**. | |
| ## Key Skills and Technologies | |
| * **Deep Learning / Transfer Learning:** DenseNet121, TensorFlow, Keras | |
| * **Computer Vision:** Image preprocessing, augmentation, classification | |
| * **Web Development:** Flask, Jinja templating, HTML/CSS | |
| * **Data Handling & Analysis:** NumPy, Pandas, visualization | |
| * **Deployment Readiness:** Modular structure, model serialization, upload handling | |
| This highlights transferable skills relevant to AI, ML, and full-stack roles. | |
| ## Dataset Information | |
| * **Dataset Name:** Yoga Pose Classification Dataset | |
| * **Source:** Kaggle | |
| * **Link:** [https://www.kaggle.com/datasets/ujjwalchowdhury/yoga-pose-classification](https://www.kaggle.com/datasets/ujjwalchowdhury/yoga-pose-classification) | |
| * **Structure:** Class-wise folders containing labeled images of yoga poses | |
| --- | |
| ## Model Architecture | |
| * **Architecture:** DenseNet121 (transfer learning) | |
| * **Pre-trained on:** ImageNet | |
| * **Input Size:** 224 Γ 224 Γ 3 | |
| * **Loss Function:** Categorical Crossentropy | |
| * **Optimizer:** Adam (Learning Rate: 1e-4) | |
| * **Evaluation Metrics:** Accuracy, Precision, Recall, F1-score | |
| The DenseNet base layers are frozen and a custom classification head is trained on the yoga pose dataset. | |
| --- | |
| ## Project Structure | |
| ``` | |
| yoga-pose-classifier/ | |
| β | |
| βββ app.py # Main Flask application | |
| βββ requirements.txt # Project dependencies | |
| βββ notebook/ # Jupyter notebook containing | |
| β βββ yoga_pose_classification.ipynb | |
| β | |
| βββ model/ | |
| β βββ model_dense121.keras # Trained DenseNet121 model | |
| β | |
| βββ utils/ | |
| β βββ allowed_file.py # File extension validation | |
| β βββ upload_file.py # Upload redirection helper | |
| β | |
| βββ static/ | |
| β βββ css/ | |
| β β βββ style.css # styling | |
| β βββ uploads/ # Uploaded images | |
| β | |
| βββ templates/ | |
| β βββ index.html # Main UI template | |
| βββ README.md | |
| ``` | |
| ## Application Workflow | |
| 1. User uploads an image via the web interface. | |
| 2. File is validated using `allowed_file()`. | |
| 3. Image is saved to `static/uploads/`. | |
| 4. Image is preprocessed for DenseNet121 input. | |
| 5. Model predicts pose and confidence. | |
| 6. Result displayed on UI. | |
| ## Utility Modules | |
| * **`allowed_file.py`**: Ensures only supported image formats are accepted. | |
| * **`upload_file.py`**: Handles clean routing for uploaded images. | |
| Modular utilities improve code readability and maintainability. | |
| ## Installation & Setup | |
| ### 1. Clone the Repository | |
| ```bash | |
| git clone https://github.com/batoolarifa/yoga-pose-classifier | |
| cd yoga-pose-classifier | |
| ``` | |
| ### 2. Install Dependencies | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ### 3. Run the Application | |
| ```bash | |
| python app.py | |
| ``` | |
| Access the app at: `http://localhost:8080` | |
| ## Model Inference Example | |
| * Upload a yoga pose image (JPG / PNG). | |
| * Model predicts one of the following poses: | |
| * Downdog | |
| * Goddess | |
| * Plank | |
| * Tree | |
| * Warrior2 | |
| * Confidence score displayed alongside prediction. | |
| ## Deployment | |
| * Ready for deployment on platforms such as **Hugging Face Spaces, Render, AWS EC2, or Docker environments**. | |
| * Model loaded once at startup for efficient inference. | |
| * Supports easy class extension and integration into larger systems. | |
| ## Industry Relevance & Value | |
| This project demonstrates: | |
| * **End-to-end ML application development** | |
| * **Deep learning expertise** | |
| * **Full-stack AI system implementation** | |
| * **Reproducible and scalable code practices** | |
| * Skills aligned with **AI/ML, Computer Vision, and Software Engineering roles** | |
| > This section highlights the projectβs alignment with industry standards and professional portfolios. | |
| ## Future Improvements | |
| * Real-time webcam inference | |
| * Pose correction feedback and tips | |
| * REST API conversion (FastAPI) | |
| * Enhanced UI accessibility and responsiveness | |
| ## π€ Author | |
| **Syeda Arifa Batool** | |
| SE @ Karachi University | AI & ML Practitioner | Applying technology to create real-world value π | |
| ## π Connect with Me | |
| - **LinkedIn:** https://www.linkedin.com/in/arifa-batool/ | |
| - **Kaggle:** https://www.linkedin.com/in/arifa-batool/ | |
| - **Email:** thearifabatool@gmail.com | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |