• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unofficial implemention of lanenet model for real time lane detection Pytorch Version

Lanenet-Lane-Detection (pytorch version)

δΈ­ζ–‡η‰ˆ

Introduction

Use pytorch to implement a Deep Neural Network for real time lane detection mainly based on the IEEE IV conference paper "Towards End-to-End Lane Detection: an Instance Segmentation Approach".You can refer to their paper for details https://arxiv.org/abs/1802.05591. This model consists of ENet encoder, ENet decoder for binary semantic segmentation and ENet decoder for instance semantic segmentation using discriminative loss function.

The main network architecture is:
NetWork_Architecture

Generate Tusimple training set/validation set/test tet

First, download tusimple dataset here.
Then, run the following command to generate the training/ val/ test samples and the train.txt/ val.txt/ test.txt file.
Generate training set:

python tusimple_transform.py --src_dir path/to/your/unzipped/file --val False

Generate training/ val set:

python tusimple_transform.py --src_dir path/to/your/unzipped/file --val True

Generate training/ val/ test set:

python tusimple_transform.py --src_dir path/to/your/unzipped/file --val True --test True

path/to/your/unzipped/file should like this:

|--dataset
|----clips
|----label_data_0313.json
|----label_data_0531.json
|----label_data_0601.json
|----test_label.json

Training the model

The environment for training and evaluation:

python=3.6
torch>=1.2
numpy=1.7
torchvision>=0.4.0
matplotlib
opencv-python
pandas

Using example folder with ENet:

python train.py --dataset ./data/training_data_example

Using tusimple folder with ENet/Focal loss:

python train.py --dataset path/to/tusimpledataset/training

Using tusimple folder with ENet/Cross Entropy loss:

python train.py --dataset path/to/tusimpledataset/training --loss_type CrossEntropyLoss

Using tusimple folder with DeepLabv3+:

python train.py --dataset path/to/tusimpledataset/training --model_type DeepLabv3+

If you want to change focal loss to cross entropy loss, do not forget to adjust the hyper-parameter of instance loss and binary loss in ./model/lanenet/train_lanenet.py

Testing result

A pretrained trained model by myself is located in ./log (only trained in 25 epochs)
Test the model:

python test.py --img ./data/tusimple_test_image/0.jpg

The testing result is here:
Input test image
Output binary image
Output instance image

Discussion:

The architecture of LaneNet is based on ENet, which is a very light model. That is why I can upload it to github. However, ENet is not the best model to detect lane and do instance segmentation. Now, the model support 2 decoder branch ENet, U-Net, DeepLabv3+ (update 2021.7.16).

Focal loss (update 2021.7.20) is also supported.

Plan and future work:

  • E-Net Encoder and E-Net decoder
  • U-Net Encoder and U-Net decoder
  • Discriminative loss for instance segmentation
  • DeepLabv3+ Encoder and DeepLabv3+ decoder (2021/7/16)
  • Focal loss for binary branch (2021/7/22)
  • [] ViT as encoder (2021/12/30)
  • [ ] Post Processing (will release 2021/7/26)
  • [ ] Use other new encoder-decoder structure
  • [ ] Add H-Net and merge the H-Net model to the main lanenet model

Future work will release soon.

Reference:

The lanenet project refers to the following research and projects:
Neven, Davy, et al. "Towards end-to-end lane detection: an instance segmentation approach." 2018 IEEE intelligent vehicles symposium (IV). IEEE, 2018.

@inproceedings{neven2018towards,
  title={Towards end-to-end lane detection: an instance segmentation approach},
  author={Neven, Davy and De Brabandere, Bert and Georgoulis, Stamatios and Proesmans, Marc and Van Gool, Luc},
  booktitle={2018 IEEE intelligent vehicles symposium (IV)},
  pages={286--291},
  year={2018},
  organization={IEEE}
}

Paszke, Adam, et al. "Enet: A deep neural network architecture for real-time semantic segmentation." arXiv preprint arXiv:1606.02147 (2016).

@article{paszke2016enet,
  title={Enet: A deep neural network architecture for real-time semantic segmentation},
  author={Paszke, Adam and Chaurasia, Abhishek and Kim, Sangpil and Culurciello, Eugenio},
  journal={arXiv preprint arXiv:1606.02147},
  year={2016}
}

De Brabandere, Bert, Davy Neven, and Luc Van Gool. "Semantic instance segmentation with a discriminative loss function." arXiv preprint arXiv:1708.02551 (2017).

@article{de2017semantic,
  title={Semantic instance segmentation with a discriminative loss function},
  author={De Brabandere, Bert and Neven, Davy and Van Gool, Luc},
  journal={arXiv preprint arXiv:1708.02551},
  year={2017}
}

https://github.com/MaybeShewill-CV/lanenet-lane-detection
https://github.com/klintan/pytorch-lanenet

DeepLabv3+ Encoder and DeepLabv3+ decoder refer from https://github.com/YudeWang/deeplabv3plus-pytorch

More Repositories

1

Awesome-Multimodal-LLM-Autonomous-Driving

[WACV 2024 Survey Paper] Multimodal Large Language Models for Autonomous Driving
210
star
2

waymo_to_semanticKITTI

Convert waymo open dataset 3D segmentation format to SemanticKITTI format.
Python
14
star
3

ViTASD

Official Implementation of ViTASD: Robust Vision Transformer Baselines for Autism Spectrum Disorder Facial Diagnosis
Python
10
star
4

Chromosome_Classification_Deep_Learning_Method

It is a project based on IJCNN's paper Automatic Chromosome Classification using Deep Attention Based Sequence Learning of Chromosome Bands and process some new methods
Jupyter Notebook
9
star
5

Gomoku-XYH19

A AI project about Gomoku
Python
6
star
6

VCog-Bench

What is the Visual Cognition Gap between Humans and Multimodal LLMs?
Python
4
star
7

MAE-ViT-pytorch

MAE-ViT-pytorch, structure is based on https://github.com/rwightman/pytorch-image-models
Python
4
star
8

Infant-Pose-pytorch

Apply OpenPose and Infant Key-point Dataset to Evaluate Infant Posture
C++
3
star
9

contour-aware-Unet

The realization of different classes of Unet framework including contour-aware-Unet, DCAN, Dual Unet, Attention Unet, Unet++
Jupyter Notebook
2
star
10

MVLM-PyTorch

Python
2
star
11

Crossing_Aggregation_Network

It is a U-Net based network which absorb ideas from deep aggregation layers(DLA), Unet++, ET-Net......
Python
2
star
12

TRN-pytorch-Temporal-Relational-Reasoning-in-Videos

Implementation for Temporal Relational Reasoning in Videos. This is a NYU course project for DS-GA 3001.004/.005 Introduction to Computer Vision (Spring 2021)
Jupyter Notebook
2
star
13

SEC-UNET_SEMANTIC_EMBEDDING_AND_CONTOUR_ASSIST_UNET_FOR_BACTERIA_SEGMENTATION-AND-DETECTION

The number of bacterial types is a critical monitoring indicator for indoor air quality standards. It is a challenging task to cultivate and count colonies of bacteria which is expertise required and time-consuming. In this work, we investigate several U-Net improvement approaches. We are motivated by the assumption that contour information and semantic embedding branch can enhance U-Net's segmentation capacity for blurred and overlapping objects. Therefore, we propose Semantic Embedding and Contour Assist U-Net (SEC-U-Net) for direct bacteria segmentation and a shallow CNN for bacteria classification. This algorithm designed the detection of bacteria as a two-stage segmentation and classification task. Experimental results demonstrate the proposed method outperforms the state-of-the-art improved U-Net approaches on our bacteria dataset. Proposed SEC-U-NET+CNN based training presented over 91% and 85% precision rate for E.coli and S.aureus, respectively.
Jupyter Notebook
2
star
14

IrohXu

1
star
15

A-miniature-relational-database-with-order

NYU Courant Database Systems, CSCI-GA.2433-011 Course Project Assignment
Python
1
star
16

irohxu.github.io

github.io for Iroh Cao
CSS
1
star
17

Chromosome_Segmentation_U-Net

It is a U-Net based project to handle the chromosome segmentation problem
Jupyter Notebook
1
star