Skip to content
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

[PaddlePaddle Hackathon] add ShuffleNetV2 #36067

Merged
merged 1 commit into from
Nov 2, 2021
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
3 changes: 2 additions & 1 deletion python/paddle/tests/test_pretrained_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def infer(self, arch):
def test_models(self):
arches = [
'mobilenet_v1', 'mobilenet_v2', 'resnet18', 'vgg16', 'alexnet',
'resnext50_32x4d', 'inception_v3', 'densenet121', 'googlenet'
'resnext50_32x4d', 'inception_v3', 'densenet121', 'googlenet',
'shufflenet_v2_x0_25', 'shufflenet_v2_swish'
]
for arch in arches:
self.infer(arch)
Expand Down
21 changes: 21 additions & 0 deletions python/paddle/tests/test_vision_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def test_densenet264(self):
def test_alexnet(self):
self.models_infer('alexnet')

def test_shufflenetv2_swish(self):
self.models_infer('shufflenet_v2_swish')

def test_resnext50_32x4d(self):
self.models_infer('resnext50_32x4d')

Expand All @@ -112,6 +115,24 @@ def test_inception_v3(self):
def test_googlenet(self):
self.models_infer('googlenet')

def test_shufflenetv2_x0_25(self):
self.models_infer('shufflenet_v2_x0_25')

def test_shufflenetv2_x0_33(self):
self.models_infer('shufflenet_v2_x0_33')

def test_shufflenetv2_x0_5(self):
self.models_infer('shufflenet_v2_x0_5')

def test_shufflenetv2_x1_0(self):
self.models_infer('shufflenet_v2_x1_0')

def test_shufflenetv2_x1_5(self):
self.models_infer('shufflenet_v2_x1_5')

def test_shufflenetv2_x2_0(self):
self.models_infer('shufflenet_v2_x2_0')

def test_vgg16_num_classes(self):
vgg16 = models.__dict__['vgg16'](pretrained=False, num_classes=10)

Expand Down
8 changes: 8 additions & 0 deletions python/paddle/vision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
from .models import inception_v3 # noqa: F401
from .models import GoogLeNet # noqa: F401
from .models import googlenet # noqa: F401
from .models import ShuffleNetV2 # noqa: F401
from .models import shufflenet_v2_x0_25 # noqa: F401
from .models import shufflenet_v2_x0_33 # noqa: F401
from .models import shufflenet_v2_x0_5 # noqa: F401
from .models import shufflenet_v2_x1_0 # noqa: F401
from .models import shufflenet_v2_x1_5 # noqa: F401
from .models import shufflenet_v2_x2_0 # noqa: F401
from .models import shufflenet_v2_swish # noqa: F401
from .transforms import BaseTransform # noqa: F401
from .transforms import Compose # noqa: F401
from .transforms import Resize # noqa: F401
Expand Down
16 changes: 16 additions & 0 deletions python/paddle/vision/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
from .inceptionv3 import inception_v3 # noqa: F401
from .googlenet import GoogLeNet # noqa: F401
from .googlenet import googlenet # noqa: F401
from .shufflenetv2 import ShuffleNetV2 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x0_25 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x0_33 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x0_5 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x1_0 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x1_5 # noqa: F401
from .shufflenetv2 import shufflenet_v2_x2_0 # noqa: F401
from .shufflenetv2 import shufflenet_v2_swish # noqa: F401

__all__ = [ #noqa
'ResNet',
Expand Down Expand Up @@ -84,4 +92,12 @@
'inception_v3',
'GoogLeNet',
'googlenet',
'ShuffleNetV2',
'shufflenet_v2_x0_25',
'shufflenet_v2_x0_33',
'shufflenet_v2_x0_5',
'shufflenet_v2_x1_0',
'shufflenet_v2_x1_5',
'shufflenet_v2_x2_0',
'shufflenet_v2_swish'
]
Loading