How himanshu-jadhav108/cricketvision_ai works
CricketVision AI classifies six cricket batting strokes from uploaded images, returning a confidence-qualified label and pose annotation. The inference path runs from the Gradio interface or FastAPI service through pose extraction, biomechanical feature construction, scaling, classification, and the confidence abstention guardrail. A separate model-development branch trains artifacts from curated feature data and evaluates model behavior. The inference internals and training script were sampled; API and evaluation implementation details were not, so those connections are documented only where the README supports them.
Main entry points: pose_extractor.py Pose Extraction · retrain.py Model Retraining · app.py Gradio App · predictor.py Shot Classifier
Components 15
User Interfaces
- Gradio App
app.py - FastAPI Service
api.py - Prediction and Annotation
app.py
Inference Pipeline
- Pose Extraction
features/pose_extractor.py - Biomechanical Features
features/feature_builder.py - Feature Scaling
predictor.py - Shot Classifier
predictor.py - Confidence Guardrail
predictor.py
Model Artifacts
- Runtime Configuration
config.py - Model Artifacts
models/xgboost_v1.pkl
Model Development
- Curated Feature Data
data/features/features_all.csv - Model Retraining
retrain.py - Model Evaluation
evaluate_model.py - Threshold Analysis
threshold_sweep.py
Other components
- Image Uploader
Connections 18
- Image Uploader → Gradio App: uploads image
README.md - Image Uploader → FastAPI Service: uploads image
README.md - Gradio App → Pose Extraction: invokes inference
app.py - FastAPI Service → Pose Extraction: invokes inference
README.md - Pose Extraction → Biomechanical Features: provides landmarks
predictor.py - Biomechanical Features → Feature Scaling: provides feature vector
predictor.py - Feature Scaling → Shot Classifier: provides scaled features
predictor.py - Shot Classifier → Confidence Guardrail: checks confidence
predictor.py - Confidence Guardrail → Prediction and Annotation: returns outcome
README.md - Gradio App → Prediction and Annotation: renders results
app.py - Runtime Configuration → Confidence Guardrail: sets threshold
predictor.py - Runtime Configuration → Pose Extraction: sets detection confidence
predictor.py - Shot Classifier → Model Artifacts: loads classifier
predictor.py - Model Retraining → Curated Feature Data: reads training data
retrain.py - Model Retraining → Biomechanical Features: uses feature names
retrain.py - Model Retraining → Model Artifacts: writes model artifacts
retrain.py - Model Evaluation → Curated Feature Data: evaluates holdout data
- Threshold Analysis → Model Artifacts: sweeps confidence thresholds