Skip to content

Add Apple's MobileOne encoder #693

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

Merged
merged 10 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,25 @@ Limitations:
</div>
</details>

<details>
<summary style="margin-left: 25px;">MobileOne</summary>
<div style="margin-left: 25px;">

Apple's "sub-one-ms" Backbone pretrained on Imagenet! Can be used with all decoders.

Note: In the official github repo the s0 variant has additional num_conv_branches, leading to more params than s1.

|Encoder |Weights |Params, M |
|--------------------------------|:------------------------------:|:------------------------------:|
|mobileone_s0 |imagenet |4.6M |
|mobileone_s1 |imagenet |4.0M |
|mobileone_s2 |imagenet |6.5M |
|mobileone_s3 |imagenet |8.8M |
|mobileone_s4 |imagenet |13.6M |

</div>
</details>


\* `ssl`, `swsl` - semi-supervised and weakly-supervised learning on ImageNet ([repo](https://github.com/facebookresearch/semi-supervised-ImageNet1K-models)).

Expand Down
17 changes: 17 additions & 0 deletions docs/encoders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,20 @@ Mix Visual Transformer
+-----------+----------+------------+
| mit\_b5 | imagenet | 81M |
+-----------+----------+------------+

MobileOne
~~~~~~~~~~~~~~~~~~~~~

+-----------------+----------+------------+
| Encoder | Weights | Params, M |
+=================+==========+============+
| mobileone\_s0 | imagenet | 4.6M |
+-----------------+----------+------------+
| mobileone\_s1 | imagenet | 4.0M |
+-----------------+----------+------------+
| mobileone\_s2 | imagenet | 6.5M |
+-----------------+----------+------------+
| mobileone\_s3 | imagenet | 8.8M |
+-----------------+----------+------------+
| mobileone\_s4 | imagenet | 13.6M |
+-----------------+----------+------------+
2 changes: 2 additions & 0 deletions segmentation_models_pytorch/encoders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .timm_mobilenetv3 import timm_mobilenetv3_encoders
from .timm_gernet import timm_gernet_encoders
from .mix_transformer import mix_transformer_encoders
from .mobileone import mobileone_encoders

from .timm_universal import TimmUniversalEncoder

Expand All @@ -44,6 +45,7 @@
encoders.update(timm_mobilenetv3_encoders)
encoders.update(timm_gernet_encoders)
encoders.update(mix_transformer_encoders)
encoders.update(mobileone_encoders)


def get_encoder(name, in_channels=3, depth=5, weights=None, output_stride=32, **kwargs):
Expand Down
Loading