To train:
python main.py all --labels dab,neutral,thumbs_up,six_seven,peace,ok,middle_finger --samples-per-label 100
To run:
python main.py app
NeuralRot classifies body gestures from webcam video and shows predictions in a frontend UI.
Current pipeline:
- Collect gesture samples (
gesture_data.csv) - Train a classifier (
gesture_model.pkl) - Run backend API (
/predict) - Run frontend UI (webcam + live prediction display)
NeuralRot/
|-- main.py # Data collection + training + one-command app launcher
|-- gesture_classifier.py # Standalone training script with augmentation
|-- backend_api.py # Flask API for live prediction from frontend frames
|-- meme_engine.py # Local OpenCV prediction loop (desktop mode)
|-- gesture_data.csv # Collected training data (label + features)
|-- gesture_model.pkl # Trained ML model
|-- requirements.txt # Cross-version dependency ranges
|-- frontend/
| |-- index.html # UI
| |-- script.js # Webcam + calls backend /predict
| |-- styles.css # Styling
| `-- README.md
`-- memes/ # Optional media assets
Create/activate a virtual environment, then install dependencies:
python -m venv venv
venv\Scripts\activate
python -m pip install -r requirements.txtRecommended Python: 3.10 to 3.12.
python main.py --run-appThen open:
http://127.0.0.1:5500
Backend health:
http://127.0.0.1:8000/health
python main.py all --labels dab,neutral --samples-per-label 100This records samples and trains gesture_model.pkl.
python main.py trainor with augmentation options:
python gesture_classifier.py --csv gesture_data.csv --model gesture_model.pkl --augment-factor 3python meme_engine.pypython main.py collect --labels dab,neutral --samples-per-label 100
python main.py train
python main.py all --labels dab,neutral
python main.py app- Frontend captures webcam frame.
- Frontend sends JPEG base64 to
POST /predict. backend_api.pyextracts pose + hands landmarks.- Feature vector is normalized and passed to model.
- Predicted label is returned to frontend.
- Frontend displays current gesture.
- Make sure
python main.py --run-appis running. - Verify backend:
http://127.0.0.1:8000/health.
- Train first:
python main.py train- Confirm
gesture_model.pklexists in project root.
- Collect more balanced data per class.
- Include a
neutralclass. - Retrain with augmentation:
python gesture_classifier.py --augment-factor 5 --jitter-std 0.02 --scale-jitter 0.08