How narukavya/ai-traffic-sign-recognition works
This is a traffic-sign recognition project with an interactive Streamlit classifier and separate scripts for preparing data, training and evaluating a CNN, and inspecting training history. The main user workflow uploads an image, resizes and normalizes it, runs inference, then displays the predicted sign and confidence. Training and evaluation are standalone scripts, not stages invoked by the app. Gemini explanation code exists, but the app explicitly disables it. Artifact links reflect matching filenames in the shown scripts; the README is empty and generated artifacts are absent from the tree.
Main entry points: train.py CNN training · app.py CNN inference · evaluate.py Model evaluation · preprocess.py Dataset preprocessing
Components 15
Image classification
- Streamlit interface
app.py - Image preparation
app.py - CNN inference
app.py - Prediction display
app.py - CLI prediction
src/predict.py
Model lifecycle
- Prepared datasets
- Dataset preprocessing
src/preprocess.py - CNN training
src/train.py - Trained CNN
Evaluation and analysis
- Model evaluation
src/evaluate.py - Training history
- History plots
src/plot_history.py
Optional explanation
- Sign explanation helper
src/gemini_helper.py
Other components
- Image uploader
- Gemini API
Connections 14
- Image uploader → Streamlit interface: uploads image
app.py - Streamlit interface → Image preparation: prepares image
app.py - Image preparation → CNN inference: supplies image
app.py - CNN inference → Prediction display: displays scores
app.py - Dataset preprocessing → Prepared datasets: writes arrays
src/preprocess.py - Prepared datasets → CNN training: loads arrays
src/train.py - CNN training → Trained CNN: saves model
src/train.py - Trained CNN → CNN inference: loads model
app.py - Prepared datasets → Model evaluation: loads test arrays
src/evaluate.py - Trained CNN → Model evaluation: loads model
src/evaluate.py - CNN training → Training history: saves history
src/train.py - Training history → History plots: loads history
src/plot_history.py - Trained CNN → CLI prediction: loads model
src/predict.py - Sign explanation helper → Gemini API: requests explanation
src/gemini_helper.py