Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
senysenyseny16 authored and Savchenko Yana committed Aug 24, 2023
0 parents commit 6a22197
Show file tree
Hide file tree
Showing 88 changed files with 8,896 additions and 0 deletions.
Empty file added .gitattributes
Empty file.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
# See https://help.github.com/articles/about-code-owners/

# Code
* @andreysher @savchenkoyana

# Actions
/.github @senysenyseny16
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches:
- main
pull_request:

jobs:
lint-python-format:
name: Python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- uses: psf/black@stable
with:
options: "--check --diff"
- uses: isort/isort-action@master
with:
configuration:
--check
--diff
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**/__pycache__
*.pyc
*vscode
**/build
evaluate
**/build
**/dist
**/*egg-info
*.lprof
.idea
*.avi
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args:
[
"--force-single-line-imports",
"--ensure-newline-before-comments",
"--line-length=120",
]
- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.3
hooks:
- id: docformatter
additional_dependencies: [tomli]
args:
[
"--in-place",
"--config",
"pyproject.toml",
]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-black
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
exclude: evaluation/culane
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-ast
- id: fix-byte-order-marker
- id: end-of-file-fixer
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: end-of-file-fixer
- id: detect-private-key
- id: no-commit-to-branch
args: ["-b=main"]
145 changes: 145 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Install

1. Clone the project

```Shell
git clone https://github.com/cfzd/Ultra-Fast-Lane-Detection-V2
cd Ultra-Fast-Lane-Detection-V2
```

1. Create a conda virtual environment and activate it

```Shell
conda create -n lane-det python=3.7 -y
conda activate lane-det
```

1. Install dependencies

```Shell
# If you dont have pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
pip install -r requirements.txt
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110
# Install Nvidia DALI (Very fast data loading lib))
cd my_interp
sh build.sh
# If this fails, you might need to upgrade your GCC to v7.3.0
```

1. Data preparation

#### **4.1 Tusimple dataset**

Download [CULane](https://xingangpan.github.io/projects/CULane.html), [Tusimple](https://github.com/TuSimple/tusimple-benchmark/issues/3), or [CurveLanes](https://github.com/SoulmateB/CurveLanes) as you want. The directory arrangement of Tusimple should look like(`test_label.json` can be downloaded from [here](https://github.com/TuSimple/tusimple-benchmark/issues/3) ):

```
$TUSIMPLE
|──clips
|──label_data_0313.json
|──label_data_0531.json
|──label_data_0601.json
|──test_tasks_0627.json
|──test_label.json
|──readme.md
```

For Tusimple, the segmentation annotation is not provided, hence we need to generate segmentation from the json annotation.

```Shell
python scripts/convert_tusimple.py --root /path/to/your/tusimple
# this will generate segmentations and two list files: train_gt.txt and test.txt
```

#### **4.2 CULane dataset**

The directory arrangement of CULane should look like:

```
$CULANE
|──driver_100_30frame
|──driver_161_90frame
|──driver_182_30frame
|──driver_193_90frame
|──driver_23_30frame
|──driver_37_30frame
|──laneseg_label_w16
|──list
```

For CULane, please run:

```Shell
python scripts/cache_culane_ponits.py --root /path/to/your/culane
# this will generate a culane_anno_cache.json file containing all the lane annotations, which can be used for speed up training without reading lane segmentation maps
```

#### **4.3 CurveLanes dataset**

The directory arrangement of CurveLanes should look like:

```
$CurveLanes
|──test
|──train
|──valid
```

For CurveLanes, please run:

```Shell
python scripts/convert_curvelanes.py --root /path/to/your/curvelanes
python scripts/make_curvelane_as_culane_test.py --root /path/to/your/curvelanes
# this will also generate a curvelanes_anno_cache_train.json file. Moreover, many .lines.txt file will be generated on the val set to enable CULane style evaluation.
```

1. Install CULane evaluation tools (Only required for testing).

If you just want to train a model or make a demo, this tool is not necessary and you can skip this step. If you want to get the evaluation results on CULane, you should install this tool.

This tools requires OpenCV C++. Please follow [here](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html) to install OpenCV C++. ***When you build OpenCV, remove the paths of anaconda from PATH or it will be failed.***

```Shell
# First you need to install OpenCV C++.
# After installation, make a soft link of OpenCV include path.
ln -s /usr/local/include/opencv4/opencv2 /usr/local/include/opencv2
```

We provide three kinds of complie pipelines to build the evaluation tool of CULane.

Option 1:

```Shell
cd evaluation/culane
make
```

Option 2:

```Shell
cd evaluation/culane
mkdir build && cd build
cmake ..
make
mv culane_evaluator ../evaluate
```

For Windows user:

```Shell
mkdir build-vs2017
cd build-vs2017
cmake .. -G "Visual Studio 15 2017 Win64"
cmake --build . --config Release
# or, open the "xxx.sln" file by Visual Studio and click build button
move culane_evaluator ../evaluate
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 zequn qin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 6a22197

Please sign in to comment.