duan8/ufld
tsieyy 30de4562bc
Adapt ufld model to tensorrt8 (#1288)
* make ufld adapt tensorrt8

* make ufld adapt tensorrt8 and tensorrt7
2023-04-19 12:45:43 +08:00
..
CMakeLists.txt Adapt ufld model to tensorrt8 (#1288) 2023-04-19 12:45:43 +08:00
common.hpp update readme 2020-11-06 23:25:34 +08:00
gen_wts.py Adapt ufld model to tensorrt8 (#1288) 2023-04-19 12:45:43 +08:00
lane_det.cpp Adapt ufld model to tensorrt8 (#1288) 2023-04-19 12:45:43 +08:00
logging.h Adapt ufld model to tensorrt8 (#1288) 2023-04-19 12:45:43 +08:00
macros.h Adapt ufld model to tensorrt8 (#1288) 2023-04-19 12:45:43 +08:00
pth2onnx.py update readme 2020-11-06 23:25:34 +08:00
README.md update readme 2020-11-06 23:25:34 +08:00

Ultra-Fast-Lane-Detection(UFLD)

The Pytorch implementation is Ultra-Fast-Lane-Detection.

How to Run

1. generate lane.wts and lane.onnx from pytorch with tusimple_18.pth

git clone https://github.com/wang-xinyu/tensorrtx.git
git clone https://github.com/cfzd/Ultra-Fast-Lane-Detection.git
// download its weights 'tusimple_18.pth'
// copy tensorrtx/ufld/gen_wts.py into Ultra-Fast-Lane-Detection/
// ensure the file name is tusimple_18.pth and lane.wts in gen_wts.py
// go to Ultra-Fast-Lane-Detection
python gen_wts.py
// a file 'lane.wts' will be generated.
// then ( not necessary )
python pth2onnx.py
//a file 'lane.onnx' will be generated.

2. build tensorrtx/ufld and run

mkdir build
cd build
cmake ..
make
sudo ./lane_det -s          // serialize model to plan file i.e. 'lane.engine'
sudo ./lane_det -d  PATH_TO_YOUR_IMAGE_FOLDER // deserialize plan file and run inference, the images will be processed.

More Information

  1. Changed the preprocess and postprocess in tensorrtx, give a different way to convert NHWC to NCHW in preprocess and just show the result using opencv rather than saving the result in postprocess.
  2. If there are some bugs where you inference with multi batch_size, just modify the code in preprocess or postprocess, it's not complicated.
  3. Some results are stored in resluts folder.