⚠️ This project is currently under development. Features and accuracy will continue to improve over time.
This is a privacy-respecting ReactJS web application that uses a machine learning model (trained in YOLO format and converted to TensorFlow.js) to detect the Rukū posture during Islamic prayer and count the number of times it is performed.
The app does not display your webcam feed, in accordance with Islamic etiquette regarding prayer.
- ✅ Detects the Rukū posture using your device's webcam
- ✅ Counts how many times Rukū has been performed
- ✅ Works in real-time, even on mobile browsers
- ✅ Uses a transparent Rukū icon instead of your actual image
- ✅ Offline-capable once deployed
- ReactJS – Frontend framework
- TensorFlow.js – For running the trained ML model in-browser
- YOLOv8 – Original training format
- ONNX → TFJS conversion – Model optimized for web
- react-webcam – To capture live video frames
- Custom pose classification logic – To control sensitivity and debounce counts
git clone https://github.com/YOUR_USERNAME/ruku-counter.git
cd ruku-counternpm installnpm startruku-counter/
├── public/
│ ├── best_web_model/ # TFJS model files (model.json, shards)
│ ├── ruku-icon.png # Transparent icon shown when Rukū is detected
├── src/
│ ├── App.js # Main app logic
│ ├── App.css # Styles
│ ├── RukuDetector.js # Detection & model loading logic
├── README.md
├── package.json
- Trained on custom Rukū images using YOLOv8
- Exported to ONNX and converted to TensorFlow.js
- Model only detects one class:
ruku - Detection thresholds and debounce logic fine-tuned to reduce false positives
You can test the app on your Android device (e.g., Galaxy S24+) using:
- Local network (with IP + port from your computer)
- Or deploy using tools like Vercel, Netlify, or GitHub Pages
- May still trigger false positives due to lack of diverse negative training samples
- Will be improved with more training data (e.g., standing, bowing halfway, background noise)
MIT License — feel free to use, contribute, and adapt with attribution.
Built with purpose to assist mindful worship through computer vision.