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 config & rename models
  • Loading branch information
Turoad committed Jun 28, 2021
commit 2c80bfe8847edb9b6841d05f2391549d39d60726
138 changes: 0 additions & 138 deletions configs/condlane/resnet101_culane_v2.py

This file was deleted.

3 changes: 1 addition & 2 deletions configs/laneatt/mobilenetv2_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
featuremap_out_channel = 1280
featuremap_out_stride = 32

aggregator = None

num_points = 72
max_lanes = 4
sample_y = range(589, 230, -20)
Expand Down Expand Up @@ -116,3 +114,4 @@
workers = 12
log_interval = 1000
seed=0
lr_update_by_epoch = False
3 changes: 1 addition & 2 deletions configs/laneatt/resnet18_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
featuremap_out_channel = 512
featuremap_out_stride = 32

aggregator = None

num_points = 72
max_lanes = 4
sample_y = range(589, 230, -20)
Expand Down Expand Up @@ -117,3 +115,4 @@
workers = 12
log_interval = 100
seed=0
lr_update_by_epoch = False
3 changes: 1 addition & 2 deletions configs/laneatt/resnet18_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
featuremap_out_channel = 512
featuremap_out_stride = 32

aggregator = None

num_points = 72
max_lanes = 5
sample_y=range(710, 150, -10)
Expand Down Expand Up @@ -115,3 +113,4 @@
workers = 12
log_interval = 100
seed=0
lr_update_by_epoch = False
3 changes: 1 addition & 2 deletions configs/laneatt/resnet34_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
featuremap_out_channel = 512
featuremap_out_stride = 32

aggregator = None

num_points = 72
max_lanes = 5
sample_y=range(710, 150, -10)
Expand Down Expand Up @@ -115,3 +113,4 @@
workers = 12
log_interval = 100
seed=0
lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/resa/resa18_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@
eval_ep = 1
save_ep = epochs
test_json_file='data/tusimple/test_label.json'
lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/resa/resa34_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/resa/resa34_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@
eval_ep = 1
save_ep = epochs
test_json_file='data/tusimple/test_label.json'
lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/resa/resa50_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/scnn/resnet18_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@
eval_ep = 1
save_ep = epochs
test_json_file='data/tusimple/test_label.json'
lr_update_by_epoch = False
1 change: 1 addition & 0 deletions configs/scnn/resnet50_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@
ignore_label = 255
log_interval = 1000

lr_update_by_epoch = False
3 changes: 1 addition & 2 deletions configs/ufld/resnet18_culane.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
)
featuremap_out_channel = 512

aggregator=None

griding_num = 200
num_classes = 4
heads = dict(type='LaneCls',
Expand Down Expand Up @@ -94,3 +92,4 @@
eval_ep = epochs // 5
save_ep = epochs
y_pixel_gap = 20
lr_update_by_epoch = False
3 changes: 1 addition & 2 deletions configs/ufld/resnet18_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
)
featuremap_out_channel = 512

aggregator=None

griding_num = 100
num_classes = 6
heads = dict(type='LaneCls',
Expand Down Expand Up @@ -111,3 +109,4 @@
save_ep = epochs
row_anchor='tusimple_row_anchor'
test_json_file='data/tusimple/test_label.json'
lr_update_by_epoch = False
2 changes: 1 addition & 1 deletion lanedet/datasets/process/generate_lane_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __call__(self, sample):
self.logger.critical('Transform annotation failed 30 times :(')
exit()

sample['img'] = img / 255.
sample['img'] = (img / 255.).astype(np.float32)
sample['lane_line'] = label

return sample
4 changes: 2 additions & 2 deletions lanedet/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .backbones import *
from .aggregator import *
from .aggregators import *
from .heads import *
from .net import *
from .nets import *
from .necks import *

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch.nn.functional as F
from torch.hub import load_state_dict_from_url

from lanedet.models.registry import AGGREGATOR
from lanedet.models.registry import AGGREGATORS

class Atrous_module(nn.Module):
def __init__(self, inplanes, planes, rate):
Expand All @@ -19,7 +19,7 @@ def forward(self, x):
return x


@AGGREGATOR.register_module
@AGGREGATORS.register_module
class ASPP(nn.Module):
def __init__(self, cfg):
super(ASPP, self).__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import torch.nn.functional as F
from torch.hub import load_state_dict_from_url

from lanedet.models.registry import AGGREGATOR
from lanedet.models.registry import AGGREGATORS
from .aspp import ASPP

@AGGREGATOR.register_module
@AGGREGATORS.register_module
class RESA(nn.Module):
def __init__(self,
direction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import torch.nn.functional as F
from torch.hub import load_state_dict_from_url

from lanedet.models.registry import AGGREGATOR
from lanedet.models.registry import AGGREGATORS


@AGGREGATOR.register_module
@AGGREGATORS.register_module
class SCNN(nn.Module):
def __init__(self, cfg=None):
super(SCNN, self).__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch
import torch.nn as nn
import torch.nn.functional as F
from lanedet.models.registry import AGGREGATOR
from lanedet.models.registry import AGGREGATORS

from mmcv.cnn import ConvModule

Expand Down Expand Up @@ -119,7 +119,7 @@ def forward(self, x, pos=None):
out_feat = self.final_conv(out_feat)
return out_feat

@AGGREGATOR.register_module
@AGGREGATORS.register_module
class TransConvEncoderModule(nn.Module):
def __init__(self, in_dim, attn_in_dims, attn_out_dims, strides, ratios, downscale=True, pos_shape=None, cfg=None):
super(TransConvEncoderModule, self).__init__()
Expand Down
6 changes: 3 additions & 3 deletions lanedet/models/backbones/erfnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from lanedet.models.registry import BACKBONE
from lanedet.models.registry import BACKBONES


class DownsamplerBlock(nn.Module):
Expand Down Expand Up @@ -155,7 +155,7 @@ def forward(self, input):
return output


@BACKBONE.register_module
@BACKBONES.register_module
class ERFNet(nn.Module):
def __init__(self, cfg): # use encoder to pass pretrained encoder
super().__init__()
Expand All @@ -164,4 +164,4 @@ def __init__(self, cfg): # use encoder to pass pretrained encoder

def forward(self, input):
output = self.encoder(input) # predict=False by default
return output
return [output]
6 changes: 3 additions & 3 deletions lanedet/models/backbones/mobilenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torchvision.models.utils import load_state_dict_from_url
from typing import Callable, Any, Optional, List

from lanedet.models.registry import BACKBONE
from lanedet.models.registry import BACKBONES


model_urls = {
Expand Down Expand Up @@ -182,7 +182,7 @@ def forward(self, x: Tensor) -> Tensor:
x = self.features(x)
return x

@BACKBONE.register_module
@BACKBONES.register_module
class MobileNet(nn.Module):
def __init__(self,
net = 'MobileNetV2',
Expand All @@ -199,4 +199,4 @@ def __init__(self,

def forward(self, x):
x = self.model(x)
return x
return [x]
Loading