Coder Social home page Coder Social logo

lzb863 / scnn_pytorch-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harryhan618/scnn_pytorch

0.0 1.0 0.0 754 KB

Pytorch implementation of "Spatial As Deep: Spatial CNN for Traffic Scene Understanding"

License: MIT License

Python 66.42% CMake 0.66% Shell 2.95% C++ 29.97%

scnn_pytorch-1's Introduction

SCNN lane detection in Pytorch

SCNN is a segmentation-tasked lane detection algorithm, described in 'Spatial As Deep: Spatial CNN for Traffic Scene Understanding'. The official implementation is in lua torch.

This repository contains a re-implementation in Pytorch.

Updates

  • 2019 / 5 / 08: Evaluation is provided.

Data preparation

CULane

The dataset is available in CULane. Please download and unzip the files in one folder, which later is represented as CULane_path. Then modify the path of CULane_path in config.py.

CULane_path
├── driver_100_30frame
├── driver_161_90frame
├── driver_182_30frame
├── driver_193_90frame
├── driver_23_30frame
├── driver_37_30frame
├── laneseg_label_w16
├── laneseg_label_w16_test
└── list

Note: absolute path is encouraged.

Tusimple

The dataset is available in here. Please download and unzip the files in one folder, which later is represented as Tusimple_path. Then modify the path of Tusimple_path in config.py.

Tusimple_path
├── clips
├── label_data_0313.json
├── label_data_0531.json
├── label_data_0601.json
└── test_label.json

Note: seg_label images and gt.txt, as in CULane dataset format, will be generated the first time Tusimple object is instantiated. It may take time.


Trained Model Provided

  • Model trained on CULane Dataset can be converted from official implementation, which can be downloaded here. Please put the vgg_SCNN_DULR_w9.t7 file into experiments/vgg_SCNN_DULR_w9.

    python experiments/vgg_SCNN_DULR_w9/t7_to_pt.py
    

    Model will be cached into experiments/vgg_SCNN_DULR_w9/vgg_SCNN_DULR_w9.pth.

    Note:torch.utils.serialization is obsolete in Pytorch 1.0+. You can directly download the converted model here.


Demo Test

For single image demo test:

python demo_test.py   -i demo/demo.jpg 
                      -w experiments/vgg_SCNN_DULR_w9/vgg_SCNN_DULR_w9.pth 
                      [--visualize / -v]


Train

  1. Specify an experiment directory, e.g. experiments/exp0. Assign the path to variable exp_dir in train.py.

  2. Modify the hyperparameters in experiments/exp0/cfg.json.

  3. Start training:

    python train.py [-r]
  4. Monitor on tensorboard:

    tensorboard --logdir='experiments/exp0' > experiments/exp0/board.log 2>&1 &
    

Note

  • My model is trained with torch.nn.DataParallel. Modify it according to your hardware configuration.
  • Currently the backbone is vgg16 from torchvision. Several modifications are done to the torchvision model according to paper, i.e., i). dilation of last three conv layer is changed to 2, ii). last two maxpooling layer is removed.

Evaluation

  • Evaluation code is ported from official implementation and a CMakeLists.txt is provided.

    cd utils/lane_evaluation
    mkdir build && cd build
    cmake ..
    make
  • Run test script

    python test.py
    

    Modify directory path exp in utils/lane_evaluation/Run.sh and run it.

    cd utils/lane_evaluation
    sh ./Run.sh
    

    The result will be stored in exp directory, e.g. experiments/vgg_SCNN_DULR_w9/evaluate.

Acknowledgement

This repos is build based on official implementation.

scnn_pytorch-1's People

Contributors

harryhan618 avatar

Watchers

James Cloos 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.