Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add condlane #20

Merged
merged 15 commits into from
Sep 11, 2021
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
Turoad committed Sep 7, 2021
commit 3fa3b9bc3037af8ee29282cabf2b482f242980a8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Supported detectors:
- [x] [UFLD](configs/ufld)
- [x] [RESA](configs/resa)
- [x] [LaneATT](configs/laneatt)
- [ ] LaneAF (comming soon)
- [x] [CondLane](configs/condlane)

## Installation
<!--
Expand Down
2 changes: 1 addition & 1 deletion configs/condlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## Models
| Architecture| Backbone |Dataset | Metric | Config| Checkpoints |
|-------------|----------|--------|--------|-------|--------------|
| CondLane | ResNet101 | CULane | F1: 76.46| [config]() |[model](https://github.com/Turoad/lanedet/releases/download/1.0/condlane_r101_culane.pth.zip) |
| CondLane | ResNet101 | CULane | F1: 79.47| [config](configs/condlane/resnet101_culane.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/condlane_r101_culane.pth.zip) |
4 changes: 2 additions & 2 deletions configs/condlane/resnet101_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
in_channels=[64, 128, 256, 512]
)

sample_y = range(589, 230, -20)
sample_y = range(590, 270, -8)

batch_size = 8
aggregator = dict(
Expand Down Expand Up @@ -163,7 +163,7 @@
),
#dict(type='Resize', size=(img_width, img_height)),
dict(type='Normalize', img_norm=img_norm),
dict(type='ToTensor', keys=['img', 'img_metas', 'gt_hm']),
dict(type='ToTensor', keys=['img', 'gt_hm']),
]


Expand Down
4 changes: 2 additions & 2 deletions configs/condlane/resnet50_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
in_channels=[64, 128, 256, 512]
)

sample_y = range(589, 230, -20)
sample_y = range(590, 270, -8)

batch_size = 8
aggregator = dict(
Expand Down Expand Up @@ -162,7 +162,7 @@
),
#dict(type='Resize', size=(img_width, img_height)),
dict(type='Normalize', img_norm=img_norm),
dict(type='ToTensor', keys=['img', 'img_metas', 'gt_hm']),
dict(type='ToTensor', keys=['img', 'gt_hm']),
]


Expand Down
2 changes: 1 addition & 1 deletion configs/laneatt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
| Architecture| Backbone |Dataset | Metric | Config| Checkpoints |
|-------------|----------|--------|--------|-------|--------------|
| LaneATT | ResNet18 | CULane | F1: 75.10 | [config](https://github.com/Turoad/lanedet/blob/main/configs/laneatt/resnet18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/laneatt_r18_culane.zip)|
|LaneATT | MobileNetV2 | CULane |F1: 74.12 | [config](https://github.com/Turoad/lanedet/blob/main/configs/laneatt/mobilenetv2_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/laneatt_mobilenetv2_culane.zip)|
|LaneATT | MobileNetV2 | CULane |F1: 74.11 | [config](https://github.com/Turoad/lanedet/blob/main/configs/laneatt/mobilenetv2_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/laneatt_mobilenetv2_culane.zip)|
| LaneATT | ResNet18 | TuSimple|acc: 95.66| [config](https://github.com/Turoad/lanedet/blob/main/configs/laneatt/resnet18_tusimple.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/laneatt_r18_tusimple.zip)|
|LaneATT | ResNet34 | TuSimple|acc: 95.81 | [config](https://github.com/Turoad/lanedet/blob/main/configs/laneatt/resnet34_tusimple.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/laneatt_r34_tusimple.zip)|

Expand Down
2 changes: 1 addition & 1 deletion configs/laneatt/mobilenetv2_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

num_points = 72
max_lanes = 4
sample_y = range(589, 230, -20)
sample_y = range(589, 230, -1)

heads = dict(type='LaneATT',
anchors_freq_path='.cache/culane_anchors_freq.pt',
Expand Down
2 changes: 1 addition & 1 deletion configs/laneatt/resnet18_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

num_points = 72
max_lanes = 4
sample_y = range(589, 230, -20)
sample_y = range(589, 230, -1)

heads = dict(type='LaneATT',
anchors_freq_path='.cache/culane_anchors_freq.pt',
Expand Down
8 changes: 4 additions & 4 deletions configs/resa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

| Architecture| Backbone |Dataset | Metric | Config| Checkpoints |
|-------------|----------|--------|--------|-------|--------------|
| RESA | ResNet50 | CULane |F1: 75.80| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa50_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r50_culane.zip)|
| RESA | ResNet34 | CULane |F1: 75.77| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa34_culane.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r34_culane.zip)|
| RESA | ResNet34 | Tusimple |acc: 96.84| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa34_tusimple.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r34_tusimple.zip)|
| RESA | ResNet18 | Tusimple |acc: 96.78| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa18_tusimple.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r18_tusimple.zip)|
| RESA | ResNet50 | CULane |F1: 75.92| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa50_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r50_culane.zip)|
| RESA | ResNet34 | CULane |F1: 75.85| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa34_culane.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r34_culane.zip)|
| RESA | ResNet34 | Tusimple |acc: 96.86| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa34_tusimple.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r34_tusimple.zip)|
| RESA | ResNet18 | Tusimple |acc: 96.73| [config](https://github.com/Turoad/lanedet/blob/main/configs/resa/resa18_tusimple.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/resa_r18_tusimple.zip)|
2 changes: 1 addition & 1 deletion configs/resa/resa34_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
lr_update_by_epoch = False
2 changes: 1 addition & 1 deletion configs/resa/resa50_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
lr_update_by_epoch = False
4 changes: 2 additions & 2 deletions configs/scnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
## Models
| Architecture| Backbone |Dataset | Metric | Config| Checkpoints |
|-------------|----------|--------|--------|-------|--------------|
| SCNN | ResNet50 | CULane | F1: 74.74| [config](https://github.com/Turoad/lanedet/blob/main/configs/scnn/resa18_culane.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/scnn_r50_culane.zip) |
| SCNN | ResNet18 | Tusimple |acc: 96.13| [config](https://github.com/Turoad/lanedet/blob/main/configs/scnn/resa18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/scnn_r18_tusimple.zip)|
| SCNN | ResNet50 | CULane | F1: 74.89| [config](https://github.com/Turoad/lanedet/blob/main/configs/scnn/resa18_culane.py) |[model](https://github.com/Turoad/lanedet/releases/download/1.0/scnn_r50_culane.zip) |
| SCNN | ResNet18 | Tusimple |acc: 96.05| [config](https://github.com/Turoad/lanedet/blob/main/configs/scnn/resa18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/scnn_r18_tusimple.zip)|
2 changes: 1 addition & 1 deletion configs/scnn/resnet50_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
lr_update_by_epoch = False
2 changes: 1 addition & 1 deletion configs/ufld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ year = {2020}
## Models
| Architecture| Backbone |Dataset | Metric | Config| Checkpoints |
|-------------|----------|--------|--------|-------|--------------|
| UFLD | ResNet18 | CULane |F1: 69.99| [config](https://github.com/Turoad/lanedet/blob/main/configs/ufld/resa18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/ufld_r18_culane.zip)|
| UFLD | ResNet18 | CULane |F1: 69.47| [config](https://github.com/Turoad/lanedet/blob/main/configs/ufld/resa18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/ufld_r18_culane.zip)|
| UFLD | ResNet18 | Tusimple |acc: 95.86| [config](https://github.com/Turoad/lanedet/blob/main/configs/ufld/resa18_culane.py) | [model](https://github.com/Turoad/lanedet/releases/download/1.0/ufld_r18_tusimple.zip)|
5 changes: 1 addition & 4 deletions lanedet/datasets/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __len__(self):

def __getitem__(self, idx):
data_info = self.data_infos[idx]
img = cv2.imread(data_info['img_path'])#.astype(np.float32)
img = cv2.imread(data_info['img_path'])
img = img[self.cfg.cut_height:, :, :]
sample = data_info.copy()
sample.update({'img': img})
Expand All @@ -49,8 +49,5 @@ def __getitem__(self, idx):
sample.update({'mask': label})

sample = self.processes(sample)
# meta = {'full_img_path': data_info['img_path'],
# 'img_name': data_info['img_name']}
# sample.update({'meta': meta})

return sample
2 changes: 1 addition & 1 deletion lanedet/datasets/culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def load_annotation(self, line):
return infos

def get_prediction_string(self, pred):
ys = np.arange(270, 590, 8) / self.cfg.ori_img_h
ys = np.array(list(self.cfg.sample_y))[::-1] / self.cfg.ori_img_h
out = []
for lane in pred:
xs = lane(ys)
Expand Down
5 changes: 1 addition & 4 deletions lanedet/datasets/process/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ def __init__(self, keys=['img', 'mask'], cfg=None):
def __call__(self, sample):
data = {}
if len(sample['img'].shape) < 3:
sample['img'] = np.expand_dims(img, -1)
sample['img'] = np.expand_dims(sample['img'], -1)
for key in self.keys:
if key == 'img_metas' or key == 'gt_masks':
data[key] = sample[key]
continue
data[key] = to_tensor(sample[key])
data['img'] = data['img'].permute(2, 0, 1)
return data
Expand Down
2 changes: 1 addition & 1 deletion lanedet/models/heads/lane_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def probmap2lane(self, probmaps, exists=None):
x = value*self.cfg.ori_img_w/self.cfg.img_width#-1.
if x > 0:
coord.append([x, y])
if len(coord) < 2:
if len(coord) < 5:
continue

coord = np.array(coord)
Expand Down
2 changes: 1 addition & 1 deletion lanedet/utils/net_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def load_network(net, model_dir, finetune_from=None, logger=None):
load_network_specified(net, finetune_from, logger)
return
pretrained_model = torch.load(model_dir)
net.load_state_dict(pretrained_model['net'], strict=False)
net.load_state_dict(pretrained_model['net'], strict=True)
6 changes: 0 additions & 6 deletions tools/.ipynb_checkpoints/detect-checkpoint.ipynb

This file was deleted.

26 changes: 0 additions & 26 deletions tools/update_config.py

This file was deleted.