Skip to content

Commit

Permalink
added mobilenetv3 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneSchulzTUBS committed Nov 16, 2020
1 parent 1340e6f commit 3c81011
Show file tree
Hide file tree
Showing 3 changed files with 641 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class ModelBackend(ABC):

def __init__(self):
self.available_backbones = ["resnet50", "efficientnetb3", "mobilenetv3_large", "mobilenetv3_small", "mobilenet_v3_minimal"]
self.available_backbones = ["resnet50", "efficientnetb3", "mobilenetv3", "mobilenetv3small"]
self.chip_size = 512
self.metrics = [
metrics.Precision(top_k=1, name='precision'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from . import inception_resnet_v2 as irv2
from . import inception_v3 as iv3
from . import mobilenet_v3 as mbnv3


class BackbonesFactory(ModelsFactory):
Expand Down Expand Up @@ -51,6 +52,8 @@ class BackbonesFactory(ModelsFactory):
'mobilenet': ('conv_pw_11_relu', 'conv_pw_5_relu', 'conv_pw_3_relu', 'conv_pw_1_relu'),
'mobilenetv2': ('block_13_expand_relu', 'block_6_expand_relu', 'block_3_expand_relu',
'block_1_expand_relu'),
'mobilenetv3': ('Conv_1', 'activation_29', 'activation_15', 'activation_6'),
'mobilenetv3small': ('activation_31', 'activation_22', 'activation_7', 'activation_3'),

# EfficientNets
'efficientnetb0': ('block6a_expand_activation', 'block4a_expand_activation',
Expand Down Expand Up @@ -84,6 +87,9 @@ class BackbonesFactory(ModelsFactory):
'efficientnetb5': [eff.EfficientNetB5, eff.preprocess_input],
'efficientnetb6': [eff.EfficientNetB6, eff.preprocess_input],
'efficientnetb7': [eff.EfficientNetB7, eff.preprocess_input],

'mobilenetv3': [mbnv3.MobileNetV3Large, mbnv3.preprocess_input],
'mobilenetv3small': [mbnv3.MobileNetV3Small, mbnv3.preprocess_input],
}

# currently not supported
Expand Down
Loading

0 comments on commit 3c81011

Please sign in to comment.