EgoLanes - Semantic Ego-Lane Boundary Segmentation
Lane boundary perception is a foundational capability for highway pilot, lane keeping assist, and autonomous path planning without relying on HD maps. EgoLanes is a legacy semantic end-to-end lane boundary segmentation network originally developed for the VisionPilot project (VisionPilot 0.9) that processes raw front-view monocular camera frames in real time.
EgoLanes follows an Encoder-Context-Decoder architecture (EfficientNet-B0 Backbone → Multi-scale Feature Fusion → Context MLP with Residual Attention → Decoder Neck with Skip Connections → 3-channel Segmentation Head) and outputs lane predictions at 1/4 of the input resolution (160px × 80px for a 640px × 320px input image), enabling fast inference on embedded hardware.
The EgoLanes model detects and classifies lane boundaries into three channels:
- Channel 0: Ego-left lane boundary
- Channel 1: Ego-right lane boundary
- Channel 2: All other lane boundaries
Performance Results
EgoLanes was trained across multiple real-world driving datasets including TuSimple, OpenLane, CurveLanes, Jiqing, and ONCE3D Lane, optimizing a lane-level binary cross-entropy loss (BCEWithLogitsLoss, weighted higher on ego-left and ego-right lanes) combined with a multi-scale edge preservation loss.
Validation Performance (640×320, 1/4 output stride)
| Dataset | Metric | Score |
|---|---|---|
| CurveLanes | mIoU | 46.9 |
| TuSimple | mIoU | 43.6 |
Embedded Inference Performance — Jetson Orin Nano (8GB)
119 GOPs; forward pass includes Host→Device (H2D) + Inference + Device→Host (D2H) at 640×320 input resolution.
| Backend | Forward [ms] | FPS |
|---|---|---|
| FP32 ONNX | 94.9 | 10.5 |
| FP32 TensorRT | 48.8 | 20.5 |
Model weights
| Variant | Input frame | Output resolution | PyTorch | ONNX FP32 |
|---|---|---|---|---|
| EgoLanes | 640x320 (2:1) | 160x80 (3 channels) | model weights | model weights |
Quick start
PyTorch (EgoLanesNetworkInfer)
Clone the EgoLanes GitHub repository, install dependencies (pip install -r requirements.txt huggingface_hub), and run:
from PIL import Image
from huggingface_hub import hf_hub_download
from Models.inference.ego_lanes_infer import EgoLanesNetworkInfer
repo_id = "AutowareFoundation/ego_lanes"
ckpt = hf_hub_download(repo_id, "models/egolanes.pth")
model = EgoLanesNetworkInfer(ckpt) # uses CUDA if available
test_img = hf_hub_download(repo_id, "assets/highway.jpg")
img = Image.open(test_img).convert("RGB")
lanes_pred = model.inference(img) # shape: (3, 80, 160) logits
print(lanes_pred.shape)
ONNX Runtime (standalone)
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download
repo_id = "AutowareFoundation/ego_lanes"
onnx_path = hf_hub_download(repo_id, "models/egolanes_fp32.onnx")
test_img = hf_hub_download(repo_id, "assets/highway.jpg")
img = Image.open(test_img).convert("RGB").resize((640, 320))
x = np.asarray(img, dtype=np.float32) / 255.0
mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
std = np.array([0.229, 0.224, 0.225], dtype=np.float32)
x = ((x - mean) / std).transpose(2, 0, 1)[None, ...]
session = ort.InferenceSession(onnx_path, providers=["CUDAExecutionProvider", "CPUExecutionProvider"])
lanes_pred = session.run(None, {"input": x})[0] # shape: (1, 3, 80, 160)
print(lanes_pred.shape)
Citation
@software{autoware_ego_lanes_2026,
author = {The Autoware Foundation},
title = {EgoLanes: Semantic ego-lane boundary segmentation model},
year = {2026},
url = {https://github.com/autowarefoundation/ego_lanes},
note = {Checkpoints: https://huggingface.co/AutowareFoundation/ego_lanes}
}
Model tree for AutowareFoundation/ego_lanes
Base model
google/efficientnet-b0