Skip to content

Commit

Permalink
remove ice and update out_indices
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-fast-track committed May 25, 2021
1 parent fc28ad6 commit 28b2ee1
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 127 deletions.
72 changes: 30 additions & 42 deletions icevision/backbones/timm/mobilenet.py
Original file line number Diff line number Diff line change
@@ -1,123 +1,111 @@
__all__ = [
# "ice_mobilenetv2_100",
# "ice_mobilenetv2_110d",
# "ice_mobilenetv2_120d",
# "ice_mobilenetv2_140",
"ice_mobilenetv3_large_075",
"ice_mobilenetv3_large_100",
"ice_mobilenetv3_rw",
"ice_mobilenetv3_small_075",
"ice_mobilenetv3_small_100",
"ice_tf_mobilenetv3_large_075",
"ice_tf_mobilenetv3_large_100",
"ice_tf_mobilenetv3_large_minimal_100",
"ice_tf_mobilenetv3_small_075",
"ice_tf_mobilenetv3_small_100",
"ice_tf_mobilenetv3_small_minimal_100",
# "mobilenetv2_100",
# "mobilenetv2_110d",
# "mobilenetv2_120d",
# "mobilenetv2_140",
"mobilenetv3_large_075",
"mobilenetv3_large_100",
"mobilenetv3_rw",
"mobilenetv3_small_075",
"mobilenetv3_small_100",
"tf_mobilenetv3_large_075",
"tf_mobilenetv3_large_100",
"tf_mobilenetv3_large_minimal_100",
"tf_mobilenetv3_small_075",
"tf_mobilenetv3_small_100",
"tf_mobilenetv3_small_minimal_100",
]

from icevision.soft_dependencies import SoftDependencies

from timm.models.mobilenetv3 import *


# def ice_mobilenetv2_100(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
# def mobilenetv2_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
# return mobilenetv2_100(
# pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
# )


# def ice_mobilenetv2_110d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
# def mobilenetv2_110d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
# return mobilenetv2_110d(
# pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
# )


# def ice_mobilenetv2_120d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
# def mobilenetv2_120d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
# return mobilenetv2_120d(
# pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
# )


# def ice_mobilenetv2_140(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
# def mobilenetv2_140(pretrained=True, out_indices=(2, 3, 4), **kwargs):
# return mobilenetv2_140(
# pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
# )


def ice_mobilenetv3_large_075(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def mobilenetv3_large_075(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return mobilenetv3_large_075(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_mobilenetv3_large_100(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def mobilenetv3_large_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return mobilenetv3_large_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_mobilenetv3_rw(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def mobilenetv3_rw(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return mobilenetv3_rw(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_mobilenetv3_small_075(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def mobilenetv3_small_075(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return mobilenetv3_small_075(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_mobilenetv3_small_100(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def mobilenetv3_small_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return mobilenetv3_small_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_large_075(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_large_075(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_large_075(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_large_100(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_large_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_large_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_large_minimal_100(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_large_minimal_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_large_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_small_075(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_small_075(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_small_075(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_small_100(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_small_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_small_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_tf_mobilenetv3_small_minimal_100(
pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs
):
def tf_mobilenetv3_small_minimal_100(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return tf_mobilenetv3_small_100(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)
32 changes: 16 additions & 16 deletions icevision/backbones/timm/resnest.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
__all__ = [
"ice_resnest14d",
"ice_resnest26d",
"ice_resnest50d",
"ice_resnest50d_1s4x24d",
"ice_resnest50d_4s2x40d",
"ice_resnest101e",
"ice_resnest200e",
"ice_resnest269e",
"resnest14d",
"resnest26d",
"resnest50d",
"resnest50d_1s4x24d",
"resnest50d_4s2x40d",
"resnest101e",
"resnest200e",
"resnest269e",
]

from icevision.soft_dependencies import SoftDependencies

from timm.models.resnest import *


def ice_resnest14d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest14d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest14d(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest26d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest26d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest26d(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest50d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest50d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest50d(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest50d_1s4x24d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest50d_1s4x24d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest50d_1s4x24d(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest50d_4s2x40d(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest50d_4s2x40d(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest50d_4s2x40d(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest101e(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest101e(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest101e(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest200e(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest200e(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest200e(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)


def ice_resnest269e(pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def resnest269e(pretrained=True, out_indices=(2, 3, 4), **kwargs):
return resnest269e(
pretrained=pretrained, features_only=True, out_indices=out_indices, **kwargs
)
2 changes: 1 addition & 1 deletion icevision/models/mmdet/backbones/timm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class MMDetTimmBase(nn.Module):
def __init__(self, pretrained=True, out_indices=(0, 1, 2, 3, 4), **kwargs):
def __init__(self, pretrained=True, out_indices=(2, 3, 4), **kwargs):
super().__init__()
self.pretrained = pretrained
self.out_indices = out_indices
Expand Down
Loading

0 comments on commit 28b2ee1

Please sign in to comment.