Coder Social home page Coder Social logo

yutong-gannis / ultra-fast-lane-detection-v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfzd/ultra-fast-lane-detection-v2

0.0 0.0 0.0 24.31 MB

Ultra Fast Deep Lane Detection With Hybrid Anchor Driven Ordinal Classification (TPAMI 2022)

License: MIT License

Shell 1.04% C++ 10.25% Python 84.68% C 0.94% MATLAB 0.18% Cuda 1.42% Makefile 0.65% CMake 0.84%

ultra-fast-lane-detection-v2's Introduction

Ultra-Fast-Lane-Detection-V2

PyTorch implementation of the paper "Ultra Fast Deep Lane Detection with Hybrid Anchor Driven Ordinal Classification".

Demo

Demo

Install

Please see INSTALL.md

Get started

Please modify the data_root in any configs you would like to run. We will use configs/culane_res18.py as an example.

To train the model, you can run:

python train.py configs/culane_res18.py --log_path /path/to/your/work/dir

or

python -m torch.distributed.launch --nproc_per_node=8 train.py configs/culane_res18.py --log_path /path/to/your/work/dir

It should be noted that if you use different number of GPUs, the learning rate should be adjusted accordingly. The configs' learning rates correspond to 8-GPU training on CULane and CurveLanes datasets. If you want to train on CULane or CurveLanes with single GPU, please decrease the learning rate by a factor of 1/8. On the Tusimple, the learning rate corresponds to single GPU training.

Trained models

We provide trained models on CULane, Tusimple, and CurveLanes.

Dataset Backbone F1 Link
CULane ResNet18 75.0 Google/Baidu
CULane ResNet34 76.0 Google/Baidu
Tusimple ResNet18 96.11 Google/Baidu
Tusimple ResNet34 96.24 Google/Baidu
CurveLanes ResNet18 80.42 Google/Baidu
CurveLanes ResNet34 81.34 Google/Baidu

For evaluation, run

mkdir tmp

python test.py configs/culane_res18.py --test_model /path/to/your/model.pth --test_work_dir ./tmp

Same as training, multi-gpu evaluation is also supported.

mkdir tmp

python -m torch.distributed.launch --nproc_per_node=8 test.py configs/culane_res18.py --test_model /path/to/your/model.pth --test_work_dir ./tmp

Visualization

We provide a script to visualize the detection results. Run the following commands to visualize on the testing set of CULane.

python demo.py configs/culane_res18.py --test_model /path/to/your/culane_res18.pth

Tensorrt Deploy

We also provide a python script to do tensorrt inference on videos.

  1. Convert to onnx model

    python deploy/pt2onnx.py --config_path configs/culane_res34.py --model_path weights/culane_res34.pth
    

    Or you can download the onnx model using the following script: https://github.com/PINTO0309/PINTO_model_zoo/blob/main/324_Ultra-Fast-Lane-Detection-v2/download.sh. And copy ufldv2_culane_res34_320x1600.onnx to weights/ufldv2_culane_res34_320x1600.onnx

  2. Convert to tensorrt model

    Use trtexec to convert engine model

    trtexec --onnx=weights/culane_res34.onnx --saveEngine=weights/culane_res34.engine

  3. Do inference

    python deploy/trt_infer.py --config_path  configs/culane_res34.py --engine_path weights/culane_res34.engine --video_path example.mp4
    

Citation

@InProceedings{qin2020ultra,
author = {Qin, Zequn and Wang, Huanyu and Li, Xi},
title = {Ultra Fast Structure-aware Deep Lane Detection},
booktitle = {The European Conference on Computer Vision (ECCV)},
year = {2020}
}

@ARTICLE{qin2022ultrav2,
  author={Qin, Zequn and Zhang, Pengyi and Li, Xi},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Ultra Fast Deep Lane Detection With Hybrid Anchor Driven Ordinal Classification}, 
  year={2022},
  volume={},
  number={},
  pages={1-14},
  doi={10.1109/TPAMI.2022.3182097}
}

ultra-fast-lane-detection-v2's People

Contributors

bennylu avatar cfzd avatar yutong-gannis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.