--- title: Othaim ALPR API emoji: 🅿️ colorFrom: green colorTo: indigo sdk: gradio sdk_version: 5.16.0 app_file: app.py pinned: false license: mit --- # Othaim Parking ALPR - Backend API FastAPI backend for the Othaim Markets parking management system, mounted with Gradio for free hosting on Hugging Face Spaces. > Check out the HF Spaces configuration reference at [huggingface.co/docs/hub/spaces-config-reference](https://huggingface.co/docs/hub/spaces-config-reference). --- ## How ALPR Works (No Local Models Needed) This backend does **not** require local model files (`car_plate_best.pt`, `model_ocr.pt`) in production. * **Remote Mode (Default):** Set `MODEL_INFERENCE_PROVIDER=remote`. The backend sends images to the pre-deployed model Space at `pant0x-ealpr-ocr-v2.hf.space` and returns the results. * **Local Mode:** Model files in the repo are intended for **local development** when running with `MODEL_INFERENCE_PROVIDER=local`. --- ## Environment Variables & Secrets | Secret | Required | Default | Description | |---|:---:|---|---| | `SUPABASE_URL` | ✅ | — | Supabase project URL | | `SUPABASE_ANON_KEY` | ✅ | — | Supabase anonymous key | | `SUPABASE_SERVICE_ROLE_KEY` | ✅ | — | Supabase service role key | | `CORS_ALLOW_ORIGINS` | ❌ | `*` | Allowed CORS origins | | `MODEL_INFERENCE_PROVIDER` | ❌ | `remote` | `remote` (calls HF Space) or `local` | | `MODEL_SERVICE_URL` | ❌ | `https://pant0x-ealpr-ocr-v2.hf.space` | Remote ALPR model URL | --- ## API Endpoints - `/docs` — Interactive Swagger UI documentation - `/health` — Health check status endpoint - `/predict` — License plate recognition inference - All 42 REST API endpoints are active and accessible via the Space wrapper.