AVIS / .env.example
X2-0's picture
HF Clean Deploy
1c0c94d
Raw
History Blame Contribute Delete
1.9 kB
# Copy to .env and fill in. All values have safe local-dev defaults.
# --- storage ---
# Local dev default = SQLite (zero setup). For the full stack use Postgres:
# DATABASE_URL=postgresql+psycopg://avis:avis@localhost:5432/avis
DATABASE_URL=sqlite:///./avis.db
IMAGE_DIR=./data/images
# --- models ---
DETECTOR_WEIGHTS=yolo11n.pt
# Local helmet YOLO model. The repo ships one at models/helmet/best.pt (7-class:
# driver/passenger x with/without helmet). With this set, helmet detection runs fully
# offline (ZERO API calls). If empty AND LLM_PROVIDER=gemini, Gemini reads helmets per
# rider (uses quota). If empty and no Gemini, helmet stays undetermined -> VLM/human.
HELMET_WEIGHTS=models/helmet/best.pt
HELMET_CONF=0.35 # confidence floor for the helmet model
HELMET_MATCH_IOU=0.4 # IoU to link a helmet box to a detected rider
# Seatbelt (Tier B) is verified by the VLM, so it costs Gemini quota. Off by default;
# set true only when you want seatbelt candidates during a demo.
SEATBELT_CHECK=false
# --- plates ---
# PLATE_PROVIDER: null (off) | fastalpr (requires `pip install fast-alpr onnxruntime`)
# With a Gemini key set, fast-alpr automatically falls back to Gemini when it reads nothing.
PLATE_PROVIDER=fastalpr
# --- VLM (free) ---
# LLM_PROVIDER: null (no VLM, escalate to human) | gemini
LLM_PROVIDER=null
GEMINI_API_KEY=
# Model served via the "gemini" provider (google-genai SDK). Options:
# gemma-3-27b-it -> highest free limits (~30 RPM / ~15,000 RPD), vision-capable (recommended)
# gemma-3-12b-it / gemma-3-4b-it -> lighter/faster, same free limits
# gemini-2.5-flash -> stronger JSON adherence but ~10 RPM / ~250 RPD
# NOTE: must be a vision model (gemma 1b is text-only and fails on image input).
GEMINI_MODEL=gemma-3-27b-it
# --- routing thresholds / fusion weights (tune in config, not in code) ---
AUTO_CONFIRM_THRESHOLD=0.85
REVIEW_THRESHOLD=0.55