[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116242":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":11,"contributorsCount":11,"subscribersCount":11,"size":11,"stars1d":11,"stars7d":13,"stars30d":13,"stars90d":11,"forks30d":11,"starsTrendScore":11,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":8,"pushedAt":20,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":11,"starSnapshotCount":11,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},116242,"medfire-watch","jasser-z\u002Fmedfire-watch","jasser-z",null,"Python",84,0,56,28,53.8,"Other",false,"main",true,[],"2026-11-03 02:27:20","2026-11-18 18:17:24","[Français](README.fr.md)\n\n# MedFire Watch\n\n[![CI][ci-badge]][ci]\n![Python 3.11](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.11-blue)\n[![AGPL-3.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-AGPL--3.0-blue)](LICENSE)\n\nMedFire Watch: wildfire and smoke detection with YOLOv8, NASA satellite hotspots, a fire-weather danger map and Telegram alerts.\n\n| Live prediction | Earth zoom and 3D city |\n| :---: | :---: |\n| ![Live camera detection running YOLOv8 displaying smoke and fire bounding boxes](docs\u002Fmedia\u002Fdemo.gif) | ![Interactive MapLibre globe zooming from Earth view to 3D city buildings](docs\u002Fmedia\u002Fearth-weather-3d.gif) |\n\n## What it does\n\n- Explore a MapLibre globe with NASA heat observations, official fire-weather danger and place forecasts.\n- Detect fire and smoke from a browser camera and queue annotated Telegram photos after persistent detections.\n- Inspect images and play original videos with aligned boxes, a detection timeline and seek prioritisation.\n- Review photo delivery attempts and download full-resolution annotated video exports.\n- Pause\u002Fresume or cancel video prediction; clear generated data from **Storage & cleanup**.\n- Manage Telegram detection beside Delete all in Alerts; edit or reset the camera cooldown from Live camera.\n\n## Quick start\n\n[Complete setup: installation, NASA key, Telegram and first run](docs\u002FGUIDE.md)\n\nPython 3.11 is strictly required (Python 3.12+ is not supported). Create the environment, install requirements, and launch services using its interpreter.\n\nWindows PowerShell:\n\n```powershell\npy -3.11 -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npip install --upgrade pip\npip install -r requirements.txt -c constraints-py311.txt\npython scripts\u002Frun_app.py\n```\n\nLinux\u002FmacOS:\n\n```bash\npython3.11 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npip install --upgrade pip\npip install -r requirements.txt -c constraints-py311.txt\npython scripts\u002Frun_app.py\n```\n\nBefore launching, copy `.env.example` to `.env` and supply your FIRMS key and Telegram bot token.\nFollow the [setup guide](docs\u002FGUIDE.md) to detect your private chat. Open\n[localhost:8501](http:\u002F\u002F127.0.0.1:8501). Image and video inference also works without these integration credentials.\n\nUnder **Live camera**, save a cooldown of 0–1440 minutes (0 disables the wait), or select\n**Reset current wait** to allow the next qualifying alert. The interval persists across restarts;\nresetting rearms detection persistence, invalidates queued old snapshots and keeps history.\nAn already transmitted Telegram request cannot be recalled.\n\nWhen `MEDFIRE_API_TOKEN` is set, native camera\u002Fvideo pages ask you to sign in once for an\neight-hour HttpOnly session. Use the same hostname for both services. Read\n[deployment boundaries](docs\u002FDEPLOYMENT.md) before remote use: Streamlit requires its own access gateway.\n\n### Configuration\n\n| Variable | Default | Purpose |\n| --- | --- | --- |\n| `FIRMS_MAP_KEY` | None | NASA FIRMS MAP_KEY for 24-hour satellite heat observations |\n| `TELEGRAM_BOT_TOKEN` | None | Telegram bot token from BotFather |\n| `TELEGRAM_CHAT_ID` | None | Telegram recipient chat ID for alert delivery |\n| `MEDFIRE_API_TOKEN` | None | Protects sensitive reads and all writes; header token or browser session |\n| `MEDFIRE_ALLOWED_HOSTS` | None | Extra allowed `Host` headers beyond localhost and loopback |\n| `MEDFIRE_ALLOWED_ORIGINS` | None | Extra allowed origins for cross-origin mutation requests |\n| `MEDFIRE_VIDEO_TTL_HOURS` | `24` | Hours to retain terminal video jobs (0–8760); weather cache retention is 24h |\n| `MEDFIRE_MAX_VIDEO_JOBS` | `2` | Maximum reserved uploads\u002Fpreparation\u002Fprocessing jobs (1–16) |\n| `MEDFIRE_MAX_STORED_VIDEO_JOBS` | `64` | Maximum active and retained video jobs (1–4096) |\n| `MEDFIRE_VIDEO_UPLOAD_TIMEOUT_SECONDS` | `300` | Upload body deadline (1–3600 seconds) |\n| `MEDFIRE_MAX_CAMERA_SESSIONS` | `64` | Camera tracker limit (1–1024); idle timeout 5 minutes |\n| `MEDFIRE_INCLUDE_LOW_CONFIDENCE` | `0` | Set to `1` to include low-confidence VIIRS satellite hotspots |\n| `MEDFIRE_SKIP_WARMUP` | `0` | Set to `1` to bypass heavy YOLO inference warmup during launch\u002Ftests |\n\n## Key results\n\n| Measurement | Result |\n| --- | --- |\n| D-Fire official test mAP50 | **0.747** on 4,306 images |\n| Test precision \u002F recall | **0.740 \u002F 0.681** |\n| GPU-scaled video analysis, batch 8 | **205.81 fps** on an NVIDIA RTX 4060 |\n| 1080p60 annotated export | **44.209 processing fps**, 1,645 input and output frames |\n\nSources: [split metrics](docs\u002Fresults\u002Fdetection_final_metrics.json), [benchmark conditions](docs\u002FVIDEO_BENCHMARK.md), [model card](docs\u002FMODEL_CARD.md).\n\n| Precision–Recall Curve | Confusion Matrix |\n| :---: | :---: |\n| ![Precision-Recall curve on the official D-Fire test split](docs\u002Fresults\u002Fdfire_official_test_PR_curve.png) | ![Confusion matrix on the official D-Fire test split](docs\u002Fresults\u002Fdfire_official_test_confusion_matrix.png) |\n| *Official D-Fire test precision–recall curve* | *Official D-Fire test confusion matrix* |\n\n## Interface\n\n| Fire Danger Map | Image Inspector |\n| :---: | :---: |\n| ![Copernicus GWIS Fire Weather Index overlay across the Mediterranean](docs\u002Fscreenshots\u002Ffire-danger.png) | ![Still image inspector showing bounding boxes and confidence scores](docs\u002Fscreenshots\u002Fimage-inspector.png) |\n| *Copernicus GWIS fire danger categories mapped in MapLibre GL* | *Single-frame inspection with bounding boxes and confidence scores* |\n\n| Live Camera Alert |\n| :---: |\n| ![Live camera view identifying smoke with persistent detection alert](docs\u002Fscreenshots\u002Flive-camera.png) |\n| *Live browser camera monitoring with IoU persistence filtering* |\n\nFor the complete interface gallery, video studio views, map credits, and Telegram delivery proof, see [Interface Screenshots](docs\u002FSCREENSHOTS.md).\n\n## How it works\n\n```mermaid\nflowchart LR\n  Providers[NASA \u002F Copernicus \u002F Open-Meteo] --> API[FastAPI and caches]\n  API --> Map[MapLibre globe]\n  Map --> UI[Streamlit]\n  Media[Camera \u002F images \u002F video] --> YOLO[YOLOv8s]\n  YOLO --> Boxes[Overlay and video export]\n  Boxes --> UI\n  YOLO --> Rules[Persistence and IoU]\n  Rules --> Telegram[Queued Telegram photos]\n```\n\n[Architecture](docs\u002FARCHITECTURE.md) explains caching, frame lookup and hardware fallbacks. [Training and evaluation](docs\u002FTRAINING.md) documents dataset preparation and held-out testing.\n\n## Limits\n\n- Satellite observations may be late, cloud-obscured or industrial heat; markers are not confirmed incidents.\n- Weather danger is not ignition probability; zoom does not improve forecast resolution and EOX imagery is dated.\n- Camera detections can miss fire or produce false alarms; held-out alerts per camera-hour are unmeasured.\n- Hardware, browser and network conditions affect latency, compatibility and delivery; VFR export support is incomplete.\n- This research application supports human investigation and requires emergency-service verification.\n\n[Detailed limits](docs\u002FLIMITATIONS.md) and [model protocol](docs\u002FMODEL_CARD.md)\n\n## Roadmap\n\nHeadless multi-camera monitoring; held-out false-alarm and time-to-alert evaluation;\nfurther deployment hardening. Optional API token checks are already implemented; see\n[deployment limitations](docs\u002FDEPLOYMENT.md) for browser login and deployment boundaries.\n\n## Development\n\nUse Node.js 22 for browser development checks. Install development dependencies and verify the test suite:\n\n```bash\npip install -r requirements-dev.txt -c constraints-py311.txt\nnpm ci\n\n# Quality gates (all must pass)\nruff check .\npytest -q\nnpm test\nnpm run format:check\npython scripts\u002Fcheck_docs.py\n```\n\nSet `MEDFIRE_SKIP_WARMUP=1` to run tests without loading model weights into memory.\nSee [Contributing Guide](CONTRIBUTING.md) for code style guidelines and [Changelog](CHANGELOG.md) for version history.\nThe [project audit](docs\u002FAUDIT.md) records verification results and outstanding dependency\u002Fdeployment findings.\n\n## Stack and layout\n\nPython 3.11, FastAPI, Streamlit, Ultralytics YOLOv8, PyTorch, OpenCV, FFmpeg,\nMapLibre GL JS, NumPy, pandas, pytest and Node.js tests.\n\n| Directory | Purpose |\n| --- | --- |\n| `api\u002F`, `dashboard\u002F` | API and browser interface |\n| `medfire_watch\u002F`, `alerts\u002F` | Detection, map services and Telegram delivery |\n| `models\u002Fdetection\u002Fweights\u002F` | Deployed checkpoint |\n| `scripts\u002F`, `configs\u002F` | Launch, refresh, training and configuration |\n| `tests\u002F`, `docs\u002F` | Checks, results and documentation |\n\n## Credits and licenses\n\nCode is released under the [AGPL-3.0 License](LICENSE), copyright Jasser Zormati.\nProvider and dataset terms apply separately; see [Third-Party Notices](THIRD_PARTY_NOTICES.md) and [Data Sources](docs\u002FDATA.md).\n\n## Author\n\nJasser Zormati · [LinkedIn](https:\u002F\u002Flinkedin.com\u002Fin\u002Fjasser-zormati) · [GitHub](https:\u002F\u002Fgithub.com\u002Fjasser-z)\n\n[ci-badge]: https:\u002F\u002Fgithub.com\u002Fjasser-z\u002Fmedfire-watch\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg\n[ci]: https:\u002F\u002Fgithub.com\u002Fjasser-z\u002Fmedfire-watch\u002Factions\u002Fworkflows\u002Fci.yml\n","MedFire Watch 是一个面向野火与烟雾监测的实时视觉预警系统。它融合 NASA 卫星热源数据（FIRMS）、气象火灾风险地图、基于 YOLOv8 的浏览器端摄像头实时检测（支持火\u002F烟识别与标注），以及 Telegram 自动告警功能；提供交互式 MapLibre 3D 地球视图、检测时间线回溯、带框视频导出与存储清理等管理能力。项目采用 Python 构建，依赖 Streamlit 提供 Web 界面，强调本地化部署与隐私可控。适用于林区巡护人员、应急响应单位及社区防火志愿者在低带宽或离线边缘场景下开展主动监测与早期预警。",2,"2026-11-24 04:53:16","CREATED_QUERY"]