Skip to content

Commit 63471c1

Browse files
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_classes
1 parent db83483 commit 63471c1

10 files changed

Lines changed: 556 additions & 419 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, "feat/**", "fix/**"]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install lightweight deps (no TensorFlow in CI)
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flask numpy Pillow pytest
24+
25+
- name: Byte-compile sources
26+
run: python -m compileall app.py
27+
28+
- name: Run smoke tests (TensorFlow mocked)
29+
run: pytest -q

0 commit comments

Comments
 (0)