Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
WongKinYiu authored May 21, 2021
1 parent 6e0b56d commit 4999157
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def create_modules(module_defs, img_size, cfg):
filters = output_filters[-1]
modules = Silence()

elif mdef['type'] == 'scale_channels': # nn.Sequential() placeholder for 'shortcut' layer
layers = mdef['from']
filters = output_filters[-1]
routs.extend([i + l if l < 0 else l for l in layers])
modules = ScaleChannel(layers=layers)

elif mdef['type'] == 'sam': # nn.Sequential() placeholder for 'shortcut' layer
layers = mdef['from']
filters = output_filters[-1]
Expand Down Expand Up @@ -501,7 +507,7 @@ def forward_once(self, x, augment=False, verbose=False):
for i, module in enumerate(self.module_list):
name = module.__class__.__name__
#print(name)
if name in ['WeightedFeatureFusion', 'FeatureConcat', 'FeatureConcat2', 'FeatureConcat3', 'FeatureConcat_l', 'ScaleSpatial']: # sum, concat
if name in ['WeightedFeatureFusion', 'FeatureConcat', 'FeatureConcat2', 'FeatureConcat3', 'FeatureConcat_l', 'ScaleChannel', 'ScaleSpatial']: # sum, concat
if verbose:
l = [i - 1] + module.layers # layers
sh = [list(x.shape)] + [list(out[i].shape) for i in module.layers] # shapes
Expand Down

0 comments on commit 4999157

Please sign in to comment.