Daemon Python que consome eventos Hikvision ISAPI, processa snapshots com OpenCV e classifica por pipeline.
Status: esqueleto em desenvolvimento. O parser custom do alarm stream ISAPI (multipart + XML, tolerante a variações de firmware) já está testado com cobertura 100% — sem câmera. Digest auth (httpx), pipeline OpenCV e config multi-câmera chegam nas próximas etapas.
uv sync --all-extras
uv run pytest # ruff + mypy + testes, sem câmerafrom isapi_event_vision import parse_alert
parse_alert(b'''<EventNotificationAlert xmlns="http://www.hikvision.com/ver20/XMLSchema">
<channelID>1</channelID><eventType>linedetection</eventType>
</EventNotificationAlert>''')
# → AlertEvent(event_type='linedetection', channel_id=1, ...)flowchart LR
CAM[(Câmera Hikvision)] -- ISAPI alertStream --> P[parser multipart+XML<br/>puro, testado]
P --> S[snapshot httpx Digest]
S --> CV[pipeline OpenCV<br/>resize → ROI → DNN]
CV --> OUT[queue / webhook]
O parser é puro (bytes → modelo), separado do transporte e da CV — testável sem câmera e alvo natural de fuzzing (atheris) por consumir entrada de alta entropia.
| Camada | Ferramenta | Status |
|---|---|---|
| Estilo & tipos | ruff + mypy --strict |
✅ em CI |
| Unit + cobertura | pytest (≥ 80%) |
✅ 100% |
| Mock server ISAPI | respx + fixtures XML |
planejado |
| Fuzzing do parser | atheris |
planejado |
| Snapshots de frame | syrupy |
planejado |
- Parser multipart + XML do alarm stream, testado (ruff/mypy/cov 100%)
- Cliente httpx com Digest auth +
respxmock server - Pipeline OpenCV (resize → ROI → MobileNet DNN) + config YAML multi-câmera
-
atherisno parser +syrupynos frames anotados
Python 3.12 · Pydantic 2 · httpx (Digest) · OpenCV 4 · NumPy · structlog · pytest · ruff · mypy
MIT — ver LICENSE.