# wvangansbeke/lanedetection_end2end architecture

> Architecture diagram of the GitHub repository wvangansbeke/lanedetection_end2end, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wvangansbeke/lanedetection_end2end
- Repository: https://github.com/wvangansbeke/lanedetection_end2end

## Overview

This repository implements two end-to-end lane-detection variants: fitting lane curves in bird’s-eye view and backprojecting them to score coordinates in the original perspective. The principal workflow loads TuSimple images and annotations, predicts lane weight maps, fits curves with differentiable weighted least squares, and trains against geometric losses; evaluation reports lane accuracy and false-positive/negative rates. The README also describes segmentation and proxy-task options. The graph preserves those capabilities at the documented module level; omitted source excerpts limit certainty about some optional wiring.

Main entry points: [`Birds_Eye_View_Loss/main.py`](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/main.py) (BEV training), [`Backprojection_Loss/main.py`](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/main.py) (Backprojection training), [`Birds_Eye_View_Loss/Networks/LSQ_layer.py`](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Networks/LSQ_layer.py) (BEV network), [`Backprojection_Loss/Networks/Least_squares_net.py`](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Networks/Least_squares_net.py) (Backprojection network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bev["Bird’s-eye fitting"]
  node_bev_main["BEV training<br/>[main.py]"]
  node_bev_data["BEV loader<br/>[Load_Data_new.py]"]
  node_bev_net["BEV network<br/>[LSQ_layer.py]"]
  node_bev_backbone["ERFNet backbone<br/>[ERFNet.py]"]
  node_bev_loss["BEV losses<br/>[Loss_crit.py]"]
  node_bev_eval["BEV evaluation<br/>[eval_lane.py]"]
end

subgraph group_back["Backprojection fitting"]
  node_back_main["Backprojection training<br/>[main.py]"]
  node_back_data["Backprojection loader<br/>[Load_Data_new.py]"]
  node_back_net["Backprojection network"]
  node_back_lsq["Backprojection fitting<br/>[LSQ_layer.py]"]
  node_back_loss["Backprojection losses<br/>[Loss_crit.py]"]
  node_back_eval["Backprojection evaluation<br/>[eval_lane.py]"]
end

subgraph group_shared["Data and evaluation"]
  node_labels_bev["Curve labels"]
  node_labels_back["Lane labels"]
  node_results["Predictions and scores"]
end

node_researcher(("Researcher"))
node_tusimple["TuSimple data"]

node_researcher -->|"starts training"| node_bev_main
node_researcher -->|"starts training"| node_back_main
node_tusimple -->|"provides images and labels"| node_bev_data
node_tusimple -->|"provides images and labels"| node_back_data
node_labels_bev -->|"supplies annotations"| node_bev_data
node_labels_back -->|"supplies annotations"| node_back_data
node_bev_main -->|"creates loaders"| node_bev_data
node_bev_main -->|"initializes and trains"| node_bev_net
node_bev_net -->|"uses backbone"| node_bev_backbone
node_bev_main -->|"computes objectives"| node_bev_loss
node_bev_main -->|"evaluates lanes"| node_bev_eval
node_bev_main -->|"writes model and metrics"| node_results
node_back_main -->|"creates loaders"| node_back_data
node_back_main -->|"initializes and trains"| node_back_net
node_back_net -->|"uses fitting layer"| node_back_lsq
node_back_main -->|"computes objectives"| node_back_loss
node_back_main -->|"evaluates lanes"| node_back_eval
node_back_main -->|"writes model and metrics"| node_results
node_bev_net -.->|"produces fitted curves"| node_bev_loss
node_back_net -.->|"produces fitted curves"| node_back_loss

click node_bev_main "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/main.py"
click node_bev_data "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Dataloader/Load_Data_new.py"
click node_bev_net "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Networks/LSQ_layer.py"
click node_bev_backbone "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Networks/ERFNet.py"
click node_bev_loss "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Loss_crit.py"
click node_bev_eval "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/eval_lane.py"
click node_back_main "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/main.py"
click node_back_data "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Dataloader/Load_Data_new.py"
click node_back_net "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Networks/Least_squares_net.py"
click node_back_lsq "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Networks/LSQ_layer.py"
click node_back_loss "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Loss_crit.py"
click node_back_eval "https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/eval_lane.py"
click node_labels_bev "https://github.com/wvangansbeke/lanedetection_end2end/tree/master/Birds_Eye_View_Loss/Labels"
click node_labels_back "https://github.com/wvangansbeke/lanedetection_end2end/tree/master/Backprojection_Loss/Labels"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bev_main,node_bev_data,node_bev_net,node_bev_backbone,node_bev_loss,node_bev_eval toneBlue
class node_back_main,node_back_data,node_back_net,node_back_lsq,node_back_loss,node_back_eval toneAmber
class node_labels_bev,node_labels_back,node_results toneMint
class node_researcher,node_tusimple toneIndigo
```

## Components

### Bird’s-eye fitting

- [BEV training](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/main.py): `Birds_Eye_View_Loss/main.py`
- [BEV loader](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Dataloader/Load_Data_new.py): `Birds_Eye_View_Loss/Dataloader/Load_Data_new.py`
- [BEV network](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Networks/LSQ_layer.py): `Birds_Eye_View_Loss/Networks/LSQ_layer.py`
- [ERFNet backbone](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Networks/ERFNet.py): `Birds_Eye_View_Loss/Networks/ERFNet.py`
- [BEV losses](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/Loss_crit.py): `Birds_Eye_View_Loss/Loss_crit.py`
- [BEV evaluation](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Birds_Eye_View_Loss/eval_lane.py): `Birds_Eye_View_Loss/eval_lane.py`

### Backprojection fitting

- [Backprojection training](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/main.py): `Backprojection_Loss/main.py`
- [Backprojection loader](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Dataloader/Load_Data_new.py): `Backprojection_Loss/Dataloader/Load_Data_new.py`
- [Backprojection network](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Networks/Least_squares_net.py): `Backprojection_Loss/Networks/Least_squares_net.py`
- [Backprojection fitting](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Networks/LSQ_layer.py): `Backprojection_Loss/Networks/LSQ_layer.py`
- [Backprojection losses](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/Loss_crit.py): `Backprojection_Loss/Loss_crit.py`
- [Backprojection evaluation](https://github.com/wvangansbeke/lanedetection_end2end/blob/master/Backprojection_Loss/eval_lane.py): `Backprojection_Loss/eval_lane.py`

### Data and evaluation

- [Curve labels](https://github.com/wvangansbeke/lanedetection_end2end/tree/master/Birds_Eye_View_Loss/Labels): `Birds_Eye_View_Loss/Labels`
- [Lane labels](https://github.com/wvangansbeke/lanedetection_end2end/tree/master/Backprojection_Loss/Labels): `Backprojection_Loss/Labels`
- **Predictions and scores**

### Other components

- **Researcher**
- **TuSimple data**

## Connections

- Researcher → BEV training: starts training
- Researcher → Backprojection training: starts training
- TuSimple data → BEV loader: provides images and labels
- TuSimple data → Backprojection loader: provides images and labels
- Curve labels → BEV loader: supplies annotations
- Lane labels → Backprojection loader: supplies annotations
- BEV training → BEV loader: creates loaders
- BEV training → BEV network: initializes and trains
- BEV network → ERFNet backbone: uses backbone
- BEV training → BEV losses: computes objectives
- BEV training → BEV evaluation: evaluates lanes
- BEV training → Predictions and scores: writes model and metrics
- Backprojection training → Backprojection loader: creates loaders
- Backprojection training → Backprojection network: initializes and trains
- Backprojection network → Backprojection fitting: uses fitting layer
- Backprojection training → Backprojection losses: computes objectives
- Backprojection training → Backprojection evaluation: evaluates lanes
- Backprojection training → Predictions and scores: writes model and metrics
- BEV network → BEV losses: produces fitted curves
- Backprojection network → Backprojection losses: produces fitted curves
