Паркинг Г4 • YOLO + CRNN • Apple Design
# 1. Клонировать и перейти
cd anpr-server
# 2. Docker (PostgreSQL + Redis)
docker-compose up -d
# 3. Python окружение
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 4. Миграция БД
alembic upgrade head
# 5. Запуск
uvicorn app.main:app --host 0.0.0.0 --port 8000Открыть: http://localhost:8000/
Swagger: http://localhost:8000/api/docs
Логин: admin / admin
Browser (Dashboard SPA)
├── REST API ← JWT Auth
└── WebSocket ws://host/ws/events ← Redis pub/sub
FastAPI Server (:8000)
├── /api/auth — JWT (login, me, RBAC)
├── /api/cameras — CRUD камер
├── /api/events — список + фильтры + stats
├── /api/settings — key-value настройки
├── /ws/events — WebSocket live feed
└── / — SPA Dashboard
Camera Workers (threading)
└── OpenCV → YOLO → Warp → CRNN → Vote → Event
ML Pipeline
├── YOLO epoch141.pt (MPS/GPU) → bbox + keypoints
├── Perspective Warp (ГОСТ 4.64:1)
└── CRNN crnn_model.pth (FP32 CPU) → CTC decode
Infrastructure (Docker)
├── PostgreSQL 15 (:5432) — 8 tables
└── Redis 7 (:6379) — pub/sub, dedup
# ML Pipeline
python -c "from app.services.ml.model_manager import ModelManager; ..."
# API
curl http://localhost:8000/api/health
curl -X POST http://localhost:8000/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"admin"}'
# Симуляция событий
python tools/simulate_events.pyanpr-server/
├── app/
│ ├── main.py # FastAPI + lifespan
│ ├── config.py # Pydantic Settings
│ ├── database.py # Async SQLAlchemy
│ ├── api/ # REST endpoints
│ ├── models/ # ORM (8 таблиц)
│ ├── schemas/ # Pydantic валидация
│ ├── services/ml/ # YOLO + CRNN + Voting
│ ├── services/events/ # Event + Webhook
│ └── workers/ # Camera Worker threads
├── static/ # Frontend Dashboard
├── models_active/ # ML модели
├── migrations/ # Alembic
├── tools/ # Утилиты
├── docker-compose.yml
├── Dockerfile
└── requirements.txt
Proprietary • Parking G4 © 2026