How ramsharma144/fruit_image_classifier works
This repository is a command-line fruit-image classifier. Its main workflows are training a CNN from a directory-organized image dataset and predicting a fruit label from one image using the saved model and class names. The training script also produces accuracy/loss plots and validation classification metrics, including a confusion matrix. The graph follows the sampled scripts and README; artifact locations are represented by their existing repository directories, not assumed generated files.
Main entry points: train_model.py Train command · predict_fruit.py Predict command · class_names.json Class names · .gitkeep Saved model
Components 14
Model training
- Train command
src/train_model.py - Fruit images
data/fruits/.gitkeep - Dataset split
src/train_model.py - CNN and augmentation
src/train_model.py - Model fitting
src/train_model.py - Validation evaluation
src/train_model.py
Model artifacts
- Saved model
models/.gitkeep - Class names
models/class_names.json - Training plots
outputs/.gitkeep
Image prediction
- Predict command
src/predict_fruit.py - Image preprocessing
src/predict_fruit.py - Model inference
src/predict_fruit.py - Label and confidence
src/predict_fruit.py
Other components
- User
Connections 19
- User → Train command: runs
README.md - Dataset split → Fruit images: loads and splits
src/train_model.py - Train command → Dataset split: creates
src/train_model.py - Train command → CNN and augmentation: builds
src/train_model.py - Train command → Class names: writes
src/train_model.py - Train command → Model fitting: fits
src/train_model.py - Model fitting → CNN and augmentation: trains
src/train_model.py - Train command → Saved model: saves
src/train_model.py - Train command → Training plots: writes plots
src/train_model.py - Train command → Validation evaluation: evaluates validation
src/train_model.py - Validation evaluation → CNN and augmentation: predicts with
src/train_model.py - User → Predict command: runs
README.md - Predict command → Saved model: loads
src/predict_fruit.py - Predict command → Class names: loads
src/predict_fruit.py - Predict command → Image preprocessing: prepares image
src/predict_fruit.py - Predict command → Model inference: predicts
src/predict_fruit.py - Model inference → Label and confidence: prints result
src/predict_fruit.py - Image preprocessing → Model inference: supplies image
src/predict_fruit.py - Class names → Label and confidence: names class
src/predict_fruit.py