Commit 63471c1
committed
feat: modernize app for current TF, fix broken UI, add tests + hygiene
App:
- Replace removed predict_classes() with model.predict() + 0.5 threshold
- Return JSON {label, pneumonia, confidence} instead of a bare string
- Create uploads dir on demand; delete uploaded X-rays after inference
- Lazy model loading with a clear error when cnn_model.h5 is absent
- Add /health probe, file-type + size validation, real error handling
- Drop obsolete TF1 graph/gevent cruft
Frontend:
- Fix example images (were D:\ Windows paths) to static/images via url_for
- Remove stray 'ships sunk by icebergs' redirect
- Swap defunct cdn.bootcss.com for jsDelivr; fix malformed form action
- Render label + confidence and surface API errors in the UI
Project hygiene:
- Add requirements.txt, MIT LICENSE, DISCLAIMER.md (medical)
- Add pytest smoke tests that mock TensorFlow (no 1GB wheel in CI)
- Add GitHub Actions CI (byte-compile + tests)
- Rewrite README (accurate run steps, API, Limitations)
- Parametrize notebook dataset path via DATA_DIR; fix fit_generator/predict_classes1 parent db83483 commit 63471c1
10 files changed
Lines changed: 556 additions & 419 deletions
File tree
- .github/workflows
- static/js
- templates
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments