A Flask image-classification project created from the mixed fruit/vegetable archive. The app keeps only fruit classes, trains a local scikit-learn image model, and presents predictions with a frontend style based on the original food recommendation system.
Kept fruit classes:
apple, banana, grapes, kiwi, lemon, mango, orange, pear, pineapple, pomegranate, watermelon
Excluded vegetable-style classes from the archive:
beetroot, bell pepper, cabbage, capsicum, carrot, cauliflower, chilli pepper, corn, cucumber, eggplant, garlic, ginger, jalepeno, lettuce, onion, paprika, peas, potato, raddish, soy beans, spinach, sweetcorn, sweetpotato, tomato, turnip
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython3 train_model.pyThis creates:
models/fruit_classifier.joblib
models/fruit_classifier.json
python3 app.pyOpen:
http://127.0.0.1:8081
If needed:
PORT=5099 python3 app.pyFor deployment, set a real Flask session secret in the environment:
SECRET_KEY="change-this-to-a-long-random-value" python3 app.pyapp.py
ml/classifier.py
templates/
static/
dataset/train/
dataset/validation/
dataset/test/
models/