Spaces:
Running
Running
File size: 1,905 Bytes
98075af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | # Backend (Phase 1)
This backend exposes your existing CV + trajectory prediction pipeline through FastAPI.
## Folder Structure
```text
backend/
app/
api/
dependencies.py
routes/
health.py
live.py
predict.py
core/
serialization.py
uploads.py
ml/
inference.py
model.py
model_fusion.py
sensor_fusion.py
legacy/
dataset.py
dataset_fusion.py
data_loader.py
cv_perception.py
map_renderer.py
visualization.py
services/
pipeline.py
main.py
schemas.py
scripts/
training/
evaluation/
data/
tools/
legacy/
requirements.txt
```
Notes:
- Runtime model and fusion logic is now under `backend/app/ml`.
- Legacy helper modules were moved under `backend/app/legacy`.
- Training, evaluation, and data scripts were moved under `backend/scripts/*`.
- Root-level `inference.py`, `model.py`, `model_fusion.py`, and `sensor_fusion.py` remain as compatibility wrappers.
## Run
From the repository root:
```powershell
.\\venv\\Scripts\\python.exe -m pip install -r backend/requirements.txt
.\\venv\\Scripts\\python.exe -m uvicorn backend.app.main:app --reload --host 0.0.0.0 --port 8000
```
## Endpoints
- `GET /api/health`
- `GET /api/live/frames?channel=CAM_FRONT&limit=200`
- `GET /api/live/frame-image?path=<dataset_frame_path>`
- `POST /api/predict/two-image` (multipart form)
- `POST /api/predict/live-fusion` (JSON body)
## Phase 2 Scene Geometry
Prediction responses now include `scene_geometry` with image-grounded BEV primitives:
- `road_polygon`: camera-derived drivable area in BEV coordinates.
- `lane_lines`: lane candidates projected into BEV.
- `elements`: projected actor footprints from detections.
- `quality`: confidence score in `[0, 1]` for extracted scene structure.
Notes:
- The backend keeps using existing model files at repository root.
- Keep running from repo root so relative data paths remain stable.
|