未验证 提交 53c7c497 编写于 作者: R redearly123 提交者: GitHub

Update base_model.py (#4728)

上级 552f5a22
...@@ -35,7 +35,7 @@ class BaseModel(nn.Layer): ...@@ -35,7 +35,7 @@ class BaseModel(nn.Layer):
model_type = config['model_type'] model_type = config['model_type']
# build transfrom, # build transfrom,
# for rec, transfrom can be TPS,None # for rec, transfrom can be TPS,None
# for det and cls, transfrom shoule to be None, # for det and cls, transfrom should be None,
# if you make model differently, you can use transfrom in det and cls # if you make model differently, you can use transfrom in det and cls
if 'Transform' not in config or config['Transform'] is None: if 'Transform' not in config or config['Transform'] is None:
self.use_transform = False self.use_transform = False
...@@ -45,7 +45,7 @@ class BaseModel(nn.Layer): ...@@ -45,7 +45,7 @@ class BaseModel(nn.Layer):
self.transform = build_transform(config['Transform']) self.transform = build_transform(config['Transform'])
in_channels = self.transform.out_channels in_channels = self.transform.out_channels
# build backbone, backbone is need for del, rec and cls # build backbone, backbone is needed for del, rec and cls
config["Backbone"]['in_channels'] = in_channels config["Backbone"]['in_channels'] = in_channels
self.backbone = build_backbone(config["Backbone"], model_type) self.backbone = build_backbone(config["Backbone"], model_type)
in_channels = self.backbone.out_channels in_channels = self.backbone.out_channels
...@@ -62,7 +62,7 @@ class BaseModel(nn.Layer): ...@@ -62,7 +62,7 @@ class BaseModel(nn.Layer):
self.neck = build_neck(config['Neck']) self.neck = build_neck(config['Neck'])
in_channels = self.neck.out_channels in_channels = self.neck.out_channels
# # build head, head is need for det, rec and cls # # build head, head is needed for det, rec and cls
config["Head"]['in_channels'] = in_channels config["Head"]['in_channels'] = in_channels
self.head = build_head(config["Head"]) self.head = build_head(config["Head"])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册