Spaces:
Sleeping
Sleeping
Commit History
-
fix: pass ruff lint+format, clean README, remove stray script
Priya Monishafa0ce5b -
fix: production audit β security hardening + observability + code qualityβ
Priya MonishaC-1 api/routes/classify.py: add missing logger (was NameError on unknown class) M-1 src/models/base_classifier.py: remove print() β logger.info already covers epoch progress m-1 src/data/dataset.py: assert -> ValueError for invalid split param SEC config.py + redis_cache.py + api/main.py: Redis password support (REDIS_PASSWORD env) SEC docker-compose.yml: conditional Redis auth (no-op when REDIS_PASSWORD empty) SEC docker-compose.airflow.yml: replace hardcoded airflow:airflow/admin:admin with env vars OBS api/prometheus_metrics.py: add http_errors Counter + models_loaded Gauge OBS api/main.py: middleware counts 4xx/5xx; models_loaded.set(1) on successful startup DOC .env.example: document REDIS_PASSWORD, AIRFLOW_DB_PASSWORD, AIRFLOW_ADMIN_PASSWORD6319415
-
section-5: fix all RCAs (BN stats, ZoomOut order, fc unfreeze, grad_clip, checkpoint format)
Priya Monisha4e27aff
-
section-5: CNN training framework β base_classifier, model_factory, 04_train_classifierβ
Priya Monishasrc/models/base_classifier.py: - train_one_epoch(): single epoch, supports GradScaler for mixed precision (EfficientNet) - evaluate(): accuracy, precision, recall, F1 (macro) via sklearn - train(): full loop with early stopping, saves best state_dict (Rule 5) - save_model() / load_model(): state_dict with weights_only=True (Rule 36) - benchmark_inference(): warmup + timed n=100 runs, returns ms/image src/models/model_factory.py: - get_model(name): vgg16, resnet50, mobilenet, efficientnet β 25-class head - VGG16: features frozen, classifier[-1] replaced (4096β25) - ResNet50: fc replaced (2048β25), caller manages 2-phase freeze/unfreeze - MobileNetV2: features frozen, classifier[-1] (1280β25) - EfficientNetB0: features frozen, classifier[-1] (1280β25) - freeze_resnet50_phase1() / unfreeze_resnet50_phase2() helpers - count_trainable_params() notebooks/04_train_classifier.py: - Parameterized: set MODEL = "vgg16"|"resnet50"|"mobilenet"|"efficientnet", run once each - FAST_MODE=False localβ¦fecb3f1