How jagratadeb/pneumonia-detector works
Pneumonia Detector is a Streamlit application for classifying chest X-rays as Normal or Viral Pneumonia. Users upload one or more images; the app validates and decodes them, runs ResNet-18, KNN, and SVM inference, averages their two-class probabilities, and presents predictions, confidence, charts, and downloadable batch results. The README documents the major capabilities; the sampled app.py excerpts show validation, classical-model preprocessing, inference calls, and result rendering, but do not expose every internal implementation detail.
Main entry points: app.py Upload and UI · resnet18_state_dict.pth ResNet-18 model · knn_model_latest.pkl KNN bundle · svm_rbf_latest.pkl SVM bundle
Components 12
Upload interface
- Upload and UI
app.py
Inference workflow
- Image validation
app.py - Image preprocessing
app.py - Probability ensemble
app.py
Classifier models
- ResNet-18 model
ResNet18/resnet18_state_dict.pth - KNN bundle
KNN/knn_model_latest.pkl - SVM bundle
SVM/svm_rbf_latest.pkl
Prediction results
- Prediction display
app.py - Confidence chart
app.py - Batch summary CSV
app.py - Session history
app.py
Other components
- Image uploader
Connections 14
- Image uploader → Upload and UI: uploads images
README.md - Upload and UI → Image validation: validates uploads
README.md - Image validation → Image preprocessing: decodes images
app.py - Image preprocessing → ResNet-18 model: prepares input
README.md - Image preprocessing → KNN bundle: prepares features
app.py - Image preprocessing → SVM bundle: prepares features
app.py - Upload and UI → ResNet-18 model: loads and runs
README.md - Upload and UI → KNN bundle: loads and runs
README.md - Upload and UI → SVM bundle: loads and runs
README.md - Upload and UI → Probability ensemble: combines scores
README.md - Probability ensemble → Prediction display: selects prediction
app.py - Prediction display → Confidence chart: shows confidence
app.py - Prediction display → Batch summary CSV: exports summary
README.md - Prediction display → Session history: updates session
app.py