A modern ML project showcasing MLOps best practices with banana ripeness classification.
Live Demo: https://daystobananadeath.streamlit.app/
This project was built as a learning exercise to master key MLOps technologies:
- Configuration Management with Hydra
- Experiment Tracking & Model Versioning with Weights & Biases
- API Development with FastAPI
- Model Deployment with ONNX Runtime
- Web Interface with Streamlit
- AI-powered banana ripeness estimation (days remaining before spoilage)
- REST API for programmatic access
- Web interface for easy image upload and prediction
- Model versioning and artifact management via W&B
- Production-ready deployment with Docker support
- PyTorch Lightning - Training framework
- Hydra - Configuration management
- Weights & Biases - Experiment tracking, model versioning
- ONNX Runtime - Model inference optimization
- FastAPI - REST API with automatic documentation
- Streamlit - Interactive web interface
- Uvicorn - ASGI server
- Albumentations - Image augmentation pipeline
- PIL/OpenCV - Image processing
- Architecture: ResNet50 & Vision Transformer (ViT-B/16)
- Dataset: 20K+ banana images across 5 ripeness stages
- Classes: unripe, ripe, overripe, rotten, unknowns
- Deployment: ONNX optimized for CPU inference
# Start the API
uvicorn src.api:app --host 0.0.0.0 --port 8000
# Test prediction
curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: multipart/form-data" \
-F "file=@banana.jpg"# Start Streamlit app
streamlit run streamlit_app.py
# Navigate to http://localhost:8501pip install -r requirements.txt
# For W&B model loading
export WANDB_API_KEY=your_api_key├── src/
│ ├── api.py # FastAPI REST endpoint
│ ├── model.py # Model architectures
│ ├── train.py # Training pipeline
│ └── inference.py # Inference utilities
├── configs/ # Hydra configuration files
├── streamlit_app.py # Web interface
├── requirements.txt # Python dependencies
└── Procfile # Deployment configuration
- Structured config files for different components (model, data, training)
- Easy experiment switching with config overrides
- Environment-specific configurations
- Automated experiment tracking with metrics logging
- Model artifact versioning and storage
- Seamless model deployment from artifacts
- Training curve visualization and comparison
- RESTful API with proper error handling
- Automatic model loading from W&B artifacts
- Health checks and monitoring endpoints
- ONNX optimization for fast inference
Built using established vision datasets:
- BananaRipeness Dataset by Chuquimarca et al.
- Additional synthetic and augmented data
The project includes production-ready deployment configurations:
- Heroku/Railway: via Procfile
- Docker: containerized deployment
- Environment variables: for secure API key management
Built to explore modern MLOps practices and deployment strategies