Pant0x's picture
fix(deploy): upgrade gradio sdk_version to 5.16.0 to resolve Hugging Face security warnings
b69c4fd
|
Raw
History Blame Contribute Delete
1.74 kB
---
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.