Skip to content

Commit

Permalink
Add InceptionNeXt and MobileViTV2 and change naming of `MobileNet…
Browse files Browse the repository at this point in the history
…*V2` and `MobileNet*V3` (#30)

* Add `InceptionNeXt`

* Add `MobileViTV2`

* Fix tests

* Fix test

* Fix format

* Fix github runner

* Fix requirements

* Update version and nit
  • Loading branch information
james77777778 authored Jan 26, 2024
1 parent 1066b55 commit 219fe28
Show file tree
Hide file tree
Showing 27 changed files with 1,317 additions and 113 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ Reference: [Grad-CAM class activation visualization (keras.io)](https://keras.io
|EfficientNetV2|[ICML 2021](https://arxiv.org/abs/2104.00298)|`timm`|`kimm.models.EfficientNetV2*`|
|GhostNet|[CVPR 2020](https://arxiv.org/abs/1911.11907)|`timm`|`kimm.models.GhostNet*`|
|GhostNetV2|[NeurIPS 2022](https://arxiv.org/abs/2211.12905)|`timm`|`kimm.models.GhostNetV2*`|
|InceptionNeXt|[arXiv 2023](https://arxiv.org/abs/2303.16900)|`timm`|`kimm.models.InceptionNeXt*`|
|InceptionV3|[CVPR 2016](https://arxiv.org/abs/1512.00567)|`timm`|`kimm.models.InceptionV3`|
|LCNet|[arXiv 2021](https://arxiv.org/abs/2109.15099)|`timm`|`kimm.models.LCNet*`|
|MobileNetV2|[CVPR 2018](https://arxiv.org/abs/1801.04381)|`timm`|`kimm.models.MobileNetV2*`|
|MobileNetV3|[ICCV 2019](https://arxiv.org/abs/1905.02244)|`timm`|`kimm.models.MobileNetV3*`|
|MobileViT|[ICLR 2022](https://arxiv.org/abs/2110.02178)|`timm`|`kimm.models.MobileViT*`|
|MobileViTV2|[arXiv 2022](https://arxiv.org/abs/2206.02680)|`timm`|`kimm.models.MobileViTV2*`|
|RegNet|[CVPR 2020](https://arxiv.org/abs/2003.13678)|`timm`|`kimm.models.RegNet*`|
|ResNet|[CVPR 2015](https://arxiv.org/abs/1512.03385)|`timm`|`kimm.models.ResNet*`|
|TinyNet|[NeurIPS 2020](https://arxiv.org/abs/2010.14819)|`timm`|`kimm.models.TinyNet*`|
Expand Down
2 changes: 1 addition & 1 deletion kimm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from kimm import models # force to add models to the registry
from kimm.utils.model_registry import list_models

__version__ = "0.1.4"
__version__ = "0.1.5"
2 changes: 1 addition & 1 deletion kimm/export/export_onnx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ExportOnnxTest(testing.TestCase, parameterized.TestCase):
def get_model(self):
input_shape = [3, 224, 224] # channels_first
model = models.MobileNet050V3Small(include_preprocessing=False)
model = models.MobileNetV3W050Small(include_preprocessing=False)
return input_shape, model

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion kimm/export/export_tflite_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class ExportTFLiteTest(testing.TestCase, parameterized.TestCase):
def get_model_and_representative_dataset(self):
input_shape = [224, 224, 3]
model = models.MobileNet050V3Small(include_preprocessing=False)
model = models.MobileNetV3W050Small(include_preprocessing=False)

def representative_dataset():
for _ in range(10):
Expand Down
1 change: 1 addition & 0 deletions kimm/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from kimm.models.densenet import * # noqa:F403
from kimm.models.efficientnet import * # noqa:F403
from kimm.models.ghostnet import * # noqa:F403
from kimm.models.inception_next import * # noqa:F403
from kimm.models.inception_v3 import * # noqa:F403
from kimm.models.mobilenet_v2 import * # noqa:F403
from kimm.models.mobilenet_v3 import * # noqa:F403
Expand Down
2 changes: 1 addition & 1 deletion kimm/models/convnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def apply_convnext_block(
):
channels_axis = -1 if backend.image_data_format() == "channels_last" else -3
input_channels = inputs.shape[channels_axis]

hidden_channels = int(mlp_ratio * output_channels)

x = inputs
shortcut = inputs

Expand Down
Loading

0 comments on commit 219fe28

Please sign in to comment.