Spaces:
Sleeping
Sleeping
Commit History
-
Default OCR off for deploy — TrOCR OOM-kills the 512MB Render worker
An OS OOM SIGKILL is uncatchable in Python, so the try/except fallback can't save it — the worker dies and the request hangs (HTTP 000 / timeout). The only reliable fix on a 512MB host is to never load TrOCR. Default ocr_enabled=False; enable locally via OCR_ENABLED=true where RAM is available. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9beb748 -
Make plate OCR deploy-safe: small TrOCR model + graceful failure
The 502 on /api/upload was TrOCR-base (~1.4GB) OOM-killing the worker on Render's 512MB instance. Fixes: - Default to microsoft/trocr-small-printed (~240MB) instead of base - Add OCR_ENABLED flag to skip OCR entirely on tiny hosts - Wrap OCR load + inference in try/except: any failure (OOM, download error) disables OCR and returns None, so analysis still returns violations instead of crashing the request with a 502 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>4cc6ef2
-
Use CPU-only PyTorch on Render to avoid 2GB+ CUDA download
Full CUDA torch stack (torch + cuDNN + triton + NCCL + ...) is ~2GB and unnecessary on Render's CPU-only servers. Pin to +cpu wheels instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>7acef8f -
Pin Python to 3.11.9 for Render deploy (pydantic-core has no py3.14 wheel)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a21aa57 -
Move edge preprocessor into backend/ and add .env.example for deployment
- ultimate_edge_preprocessor.py copied into backend/ so Render can import it without needing the repo root on sys.path - Removed the sys.path hack from config.py (no longer needed) - Added .env.example documenting all required environment variables Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>62bbce1 -
Add violation rules, NETRA UI overhaul, MongoDB challan store, and model weights
- Illegal parking: zone-based polygon detection (image) + dwell-time tracker (video) - Seatbelt non-compliance: absence-based YOLO detection on car crops - Wrong-side driving: motion-based video tracker + model-based image path (gated on weight file) - Red-light running: stop-line crossing detection with enforcement flag - TrOCR plate OCR: replaced EasyOCR with microsoft/trocr-base-printed, targeted per-offending-vehicle - MongoDB challan store: best-effort Atlas connection, two_wheeler/four_wheeler folder hierarchy - NETRA command-center UI: navy palette, blueprint grid, SensorFusion tri-modal panel, violation modal - Multi-file sequential upload on Analyze page - Records page: data-driven type filter, no Review column - Include yolov8n.pt, helmet_yolo11n_v2_best.pt, seatbelt.pt (all ≤7MB); removed 224MB of unused weights Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f184c04
-
Integrate weather-adaptive edge preprocessor into the pipeline
har2312 +1: Claude Opus 4.8Wire DynamicTrafficPreprocessor (ultimate_edge_preprocessor.py) into the upload pipeline as the front-end cleaning step: - Detect scene condition (FOG/NIGHT/DAY-RAIN) and feed the cleaned 640x640 letterboxed frame to detection, violation rules, annotation and evidence. - Run ANPR on the full-resolution, weather-corrected frame instead — detection boxes are mapped back from 640x640 to original pixels (letterbox_params / unletterbox_bbox) so plate detail isn't lost to downscaling. - Preserve the UI quality report via preprocessor.assess() (no double-cleaning). - Log the condition: terminal print, evidence-image label, metadata, and a new weather_condition field on the /api/upload response. - Share the enhancement chain between the 640 and full-res paths (_apply_chain) and make matplotlib a lazy import so the headless backend can import the class. - Guard against undecodable uploads with an HTTP 400. Tooling/docs: - config.py puts the repo root on sys.path so the root-level mo…58a8d53 -
plate recog by TrOCR and frontend and some other things updated
f09c2db
-
basic architecture defined
5fdeef5