-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c84a689
Showing
43 changed files
with
1,619 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
*.pyc | ||
.ipynb_checkpoints | ||
*~ | ||
*# | ||
build* | ||
|
||
# Packages # | ||
################### | ||
# it's better to unpack these files and commit the raw source | ||
# git has its own built in compression methods | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.sqlite | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Images | ||
###################### | ||
*.jpg | ||
*.gif | ||
*.png | ||
*.svg | ||
*.ico | ||
|
||
# Video | ||
###################### | ||
*.wmv | ||
*.mpg | ||
*.mpeg | ||
*.mp4 | ||
*.mov | ||
*.flv | ||
*.avi | ||
*.ogv | ||
*.ogg | ||
*.webm | ||
|
||
# Audio | ||
###################### | ||
*.wav | ||
*.mp3 | ||
*.wma | ||
|
||
# Fonts | ||
###################### | ||
Fonts | ||
*.eot | ||
*.ttf | ||
*.woff | ||
|
||
# Format | ||
###################### | ||
CPPLINT.cfg | ||
.clang-format | ||
|
||
# Gtags | ||
###################### | ||
GPATH | ||
GRTAGS | ||
GSYMS | ||
GTAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Lanenet with Enet backbone ## | ||
*** | ||
|
||
### Dataset ### | ||
- [TuSimple Lane Detection](https://github.com/TuSimple/tusimple-benchmark/issues/3) | ||
|
||
### Test Sample ### | ||
*** | ||
|
||
![test sample](./docs/images/result.gif) | ||
|
||
### References ### | ||
- [Towards End-to-End Lane Detection: an Instance Segmentation Approach](https://arxiv.org/pdf/1802.05591.pdf) | ||
- [Learning Lightweight Lane Detection CNNs by Self Attention Distillation](https://arxiv.org/pdf/1908.00821.pdf) | ||
- [Semantic Instance Segmentation with a Discriminative Loss Function](https://arxiv.org/pdf/1708.02551.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
|
||
_CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
class Config(object): | ||
def __init__(self): | ||
self.CURRENT_DIR = _CURRENT_DIR | ||
|
||
self.DATA_PATH = os.path.abspath(os.path.join(_CURRENT_DIR, "data")) | ||
|
||
self.SAVED_MODEL_PATH = os.path.abspath( | ||
os.path.join(_CURRENT_DIR, "saved_models") | ||
) | ||
if not os.path.isdir(self.SAVED_MODEL_PATH): | ||
os.system("mkdir -p {}".format(self.SAVED_MODEL_PATH)) | ||
|
||
def display(self): | ||
""" | ||
Display Configuration values. | ||
""" | ||
print("\nConfigurations:") | ||
for a in dir(self): | ||
if not a.startswith("__") and not callable(getattr(self, a)): | ||
print("{:30} {}".format(a, getattr(self, a))) | ||
print("\n") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from .tu_simple_dataset import TuSimpleDataset | ||
from .tu_simple_data_transform import TuSimpleDataTransform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from albumentations import Compose | ||
|
||
|
||
class DataTransformBase(object): | ||
def __init__(self): | ||
self._train_transform_list = [] | ||
self._val_transform_list = [] | ||
|
||
self._transforms_dict = {} | ||
|
||
def _initialize_transform_dict(self): | ||
self._transforms_dict["train"] = Compose(self._train_transform_list) | ||
self._transforms_dict["val"] = Compose(self._val_transform_list) | ||
|
||
def __call__(self, image, mask=None, phase=None): | ||
if phase is None: | ||
return self._transforms_dict["val"](image=image)["image"] | ||
|
||
assert phase in ("train", "val") | ||
assert mask is not None | ||
|
||
augmented = self._transforms_dict[phase](image=image, masks=[mask]) | ||
|
||
return augmented["image"], augmented["masks"][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from .data_transform_base import DataTransformBase | ||
from albumentations import ( | ||
Resize, | ||
HorizontalFlip, | ||
Normalize, | ||
GaussNoise, | ||
RandomBrightnessContrast, | ||
RandomShadow, | ||
RandomRain, | ||
Rotate, | ||
ShiftScaleRotate, | ||
RandomResizedCrop, | ||
) | ||
from albumentations.pytorch import ToTensor | ||
import random | ||
|
||
|
||
class TuSimpleDataTransform(DataTransformBase): | ||
def __init__(self, num_classes, input_size): | ||
super(TuSimpleDataTransform, self).__init__() | ||
|
||
random.seed(1000) | ||
height, width = input_size | ||
|
||
self._train_transform_list = self._train_transform_list + [ | ||
HorizontalFlip(p=0.5), | ||
GaussNoise(p=0.5), | ||
RandomBrightnessContrast(p=0.5), | ||
RandomShadow(p=0.5), | ||
RandomRain(rain_type="drizzle", p=0.5), | ||
ShiftScaleRotate(rotate_limit=10, p=0.5), | ||
RandomResizedCrop( | ||
height=height, width=width, scale=(0.8, 1), p=0.5 | ||
), | ||
] | ||
|
||
self._train_transform_list.append(Resize(height, width)) | ||
self._val_transform_list.append(Resize(height, width)) | ||
|
||
self._train_transform_list.append(ToTensor(num_classes=num_classes)) | ||
self._val_transform_list.append(ToTensor(num_classes=num_classes)) | ||
|
||
self._initialize_transform_dict() |
Oops, something went wrong.