feat: initial BantayCam scaffold

- FastAPI backend with async SQLAlchemy
- Camera RTSP management (add, start, stop)
- Vehicle detection (YOLO + fast-alpr)
  - Type: car, motorcycle, truck, jeepney
  - Color detection (HSV)
  - License plate OCR
  - Motorcycle person count
- Face detection + InsightFace ArcFace embedding
- pgvector identity grouping (auto-cluster same face)
- Vehicle + person movement trail APIs
- Docker Compose with pgvector/pg16
- Models: Camera, VehicleIdentity, VehicleEvent, PersonIdentity, FaceEvent
This commit is contained in:
Nemo
2026-03-12 12:11:02 +08:00
commit 7c43e4580d
24 changed files with 1650 additions and 0 deletions

37
docker-compose.yml Normal file
View File

@@ -0,0 +1,37 @@
version: "3.9"
services:
postgres:
image: pgvector/pgvector:pg16
container_name: bantaycam-db
environment:
POSTGRES_USER: bantaycam
POSTGRES_PASSWORD: bantaycam
POSTGRES_DB: bantaycam
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: bantaycam-api
depends_on:
- postgres
environment:
DATABASE_URL: postgresql+asyncpg://bantaycam:bantaycam@postgres:5432/bantaycam
STORAGE_PATH: /app/snapshots
GPU_DEVICE: -1 # Change to 0 for GPU
ports:
- "8000:8000"
volumes:
- ./snapshots:/app/snapshots
- ./backend:/app
restart: unless-stopped
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
volumes:
pgdata: