Transform https://github.com/millenniumsingha/StyleNet from a basic ML notebook into a production-ready application with CNN model, REST API, and web interface.
# Create directories
mkdir -p src api app tests models notebooks legacy
# Move original notebook
mv StyleNet.ipynb legacy/
# Create placeholder files
touch src/__init__.py api/__init__.py tests/__init__.py models/.gitkeepCreate these files with contents from the main guide (FashionMNIST_Upgrade_Guide.md):
Priority 1 (Required for functionality):
requirements.txtsrc/config.pysrc/model.pysrc/train.pysrc/predict.pyapi/main.pyapi/schemas.pyapp/streamlit_app.py
Priority 2 (Required for deployment):
9. Dockerfile
10. docker-compose.yml
11. .gitignore
12. .dockerignore
13. README.md
Priority 3 (Quality assurance):
14. tests/test_model.py
15. tests/test_api.py
# Install dependencies
pip install -r requirements.txt
# Train model (should achieve ~92% accuracy)
python -m src.train --model cnn --epochs 15
# Run tests
pytest tests/ -v
# Test API
uvicorn api.main:app --port 8000 &
curl http://localhost:8000/health
# Test Streamlit
streamlit run app/streamlit_app.py --server.port 8501git add .
git commit -m "Upgrade to production-ready ML application
- Added CNN model architecture (92%+ accuracy)
- Added FastAPI REST API with /predict endpoint
- Added Streamlit web interface
- Added Docker containerization
- Added comprehensive tests
- Restructured project for production use
- Archived original notebook in legacy/"
git push origin masterStyleNet/
├── README.md
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
├── .gitignore
├── .dockerignore
├── src/
│ ├── __init__.py
│ ├── config.py
│ ├── model.py
│ ├── train.py
│ └── predict.py
├── api/
│ ├── __init__.py
│ ├── main.py
│ └── schemas.py
├── app/
│ └── streamlit_app.py
├── tests/
│ ├── __init__.py
│ ├── test_model.py
│ └── test_api.py
├── models/
│ └── .gitkeep
├── notebooks/
├── images/
│ └── (keep existing)
└── legacy/
└── StyleNet.ipynb
- Model trains to 92%+ test accuracy
- API responds at http://localhost:8000/docs
- Streamlit loads at http://localhost:8501
- All tests pass
- Docker builds successfully
- README renders correctly on GitHub
See FashionMNIST_Upgrade_Guide.md for complete file contents.