How mksathish64-sk/fruit-classifier-cnn works
Fruit Vision classifies uploaded fruit images and presents the predicted class and class probabilities in a browser. Its main workflow is browser upload → FastAPI image preprocessing and CNN inference → probability response → browser results. A separate educational frontend simulator illustrates CNN stages; its visual calculations are not the trained model’s internal activations. The repository also includes a training script that saves the model artifact and a command-line prediction path. Runtime relationships are based on the excerpts and README; the dataset-loading module described by the training script is absent from the supplied tree.
Main entry points: script.js Stage simulation · server.py Predict endpoint · index.html Upload and results UI · fruit_classifierV3.keras Trained model
Components 15
Web experience
- Upload and results UI
frontend/index.html - Upload interaction
frontend/script.js
Prediction API
- Predict endpoint
server.py - Image preprocessing
server.py - Class probabilities
server.py
CNN model
- Trained model
fruit_classifierV3.keras - CNN training
scripts/model/cnn_model.py - CLI prediction
scripts/prediction/predict.py
CNN visualization
- Stage simulation
frontend/script.js - Convolution demo
frontend/script.js - ReLU demo
frontend/script.js - Pooling demo
frontend/script.js - Flatten and dense
frontend/script.js - Softmax display
frontend/script.js
Other components
- Fruit user
Connections 17
- Fruit user → Upload and results UI: uploads image
README.md - Upload and results UI → Upload interaction: handles interaction
frontend/script.js - Upload interaction → Predict endpoint: posts image
README.md - Predict endpoint → Image preprocessing: processes image
server.py - Predict endpoint → Class probabilities: runs prediction
server.py - Class probabilities → Trained model: loads model
server.py - Predict endpoint → Upload interaction: returns probabilities
README.md - Upload interaction → Upload and results UI: displays result
README.md - CNN training → Trained model: saves model
scripts/model/cnn_model.py - CLI prediction → Trained model: loads model
scripts/prediction/predict.py - Fruit user → Stage simulation: starts demo
README.md - Stage simulation → Convolution demo: animates stage
frontend/script.js - Stage simulation → ReLU demo: animates stage
frontend/script.js - Stage simulation → Pooling demo: animates stage
frontend/script.js - Stage simulation → Flatten and dense: animates stages
README.md - Stage simulation → Softmax display: shows probabilities
README.md - Softmax display → Upload interaction: uses prediction
frontend/script.js