hubconf.py 19.0 KB
Newer Older
L
for hub  
lyuwenyu 已提交
1

L
lyuwenyu 已提交
2
dependencies = ['paddle', 'numpy']
L
for hub  
lyuwenyu 已提交
3

L
lyuwenyu 已提交
4
import paddle
L
for hub  
lyuwenyu 已提交
5

L
lyuwenyu 已提交
6 7
from ppcls.modeling.architectures import alexnet as _alexnet
from ppcls.modeling.architectures import vgg as _vgg 
L
lyuwenyu 已提交
8
from ppcls.modeling.architectures import resnet as _resnet 
L
lyuwenyu 已提交
9 10 11 12
from ppcls.modeling.architectures import squeezenet as _squeezenet
from ppcls.modeling.architectures import densenet as _densenet
from ppcls.modeling.architectures import inception_v3 as _inception_v3
from ppcls.modeling.architectures import inception_v4 as _inception_v4
L
lyuwenyu 已提交
13 14 15 16 17 18 19
from ppcls.modeling.architectures import googlenet as _googlenet
from ppcls.modeling.architectures import shufflenet_v2 as _shufflenet_v2
from ppcls.modeling.architectures import mobilenet_v1 as _mobilenet_v1
from ppcls.modeling.architectures import mobilenet_v2 as _mobilenet_v2
from ppcls.modeling.architectures import mobilenet_v3 as _mobilenet_v3
from ppcls.modeling.architectures import resnext as _resnext

L
lyuwenyu 已提交
20

L
lyuwenyu 已提交
21 22 23 24
# _checkpoints = {
#     'ResNet18': 'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet18_pretrained.pdparams',
#     'ResNet34': 'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet34_pretrained.pdparams',
# }
L
lyuwenyu 已提交
25

L
lyuwenyu 已提交
26

L
lyuwenyu 已提交
27 28 29 30
def _load_pretrained_urls():
    '''Load pretrained model parameters url from README.md
    '''
    import re
L
lyuwenyu 已提交
31
    import os
L
lyuwenyu 已提交
32 33
    from collections import OrderedDict

L
lyuwenyu 已提交
34 35 36
    readme_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.md')

    with open(readme_path, 'r') as f:
L
lyuwenyu 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
        lines = f.readlines()
        lines = [lin for lin in lines if lin.strip().startswith('|') and 'Download link' in lin]
    
    urls = OrderedDict()
    for lin in lines:
        try:
            name = re.findall(r'\|(.*?)\|', lin)[0].strip().replace('<br>', '')
            url = re.findall(r'\((.*?)\)', lin)[-1].strip()
            if name in url:
                urls[name] = url
        except:
            pass

    return urls


_checkpoints = _load_pretrained_urls()
L
lyuwenyu 已提交
54

L
lyuwenyu 已提交
55

L
lyuwenyu 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129

def AlexNet(**kwargs):
    '''AlexNet
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _alexnet.AlexNet(**kwargs)
    if pretrained:
        assert 'AlexNet' in _checkpoints, 'Not provide `AlexNet` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['AlexNet'])
        model.set_state_dict(paddle.load(path))

    return model



def VGG11(**kwargs):
    '''VGG11
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _vgg.VGG11(**kwargs)
    if pretrained:
        assert 'VGG11' in _checkpoints, 'Not provide `VGG11` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['VGG11'])
        model.set_state_dict(paddle.load(path))

    return model


def VGG13(**kwargs):
    '''VGG13
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _vgg.VGG13(**kwargs)
    if pretrained:
        assert 'VGG13' in _checkpoints, 'Not provide `VGG13` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['VGG13'])
        model.set_state_dict(paddle.load(path))

    return model


def VGG16(**kwargs):
    '''VGG16
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _vgg.VGG16(**kwargs)
    if pretrained:
        assert 'VGG16' in _checkpoints, 'Not provide `VGG16` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['VGG16'])
        model.set_state_dict(paddle.load(path))

    return model


def VGG19(**kwargs):
    '''VGG19
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _vgg.VGG19(**kwargs)
    if pretrained:
        assert 'VGG19' in _checkpoints, 'Not provide `VGG19` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['VGG19'])
        model.set_state_dict(paddle.load(path))

    return model




L
lyuwenyu 已提交
130 131
def ResNet18(**kwargs):
    '''ResNet18
L
for hub  
lyuwenyu 已提交
132
    '''
L
lyuwenyu 已提交
133 134
    pretrained = kwargs.pop('pretrained', False)

L
lyuwenyu 已提交
135
    model = _resnet.ResNet18(**kwargs)
L
lyuwenyu 已提交
136
    if pretrained:
L
lyuwenyu 已提交
137
        assert 'ResNet18' in _checkpoints, 'Not provide `ResNet18` pretrained model.'
L
lyuwenyu 已提交
138 139 140
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ResNet18'])
        model.set_state_dict(paddle.load(path))

L
for hub  
lyuwenyu 已提交
141 142
    return model

L
lyuwenyu 已提交
143 144 145 146

def ResNet34(**kwargs):
    '''ResNet34
    '''
L
lyuwenyu 已提交
147 148 149 150 151 152 153
    pretrained = kwargs.pop('pretrained', False)

    model = _resnet.ResNet34(**kwargs)
    if pretrained:
        assert 'ResNet34' in _checkpoints, 'Not provide `ResNet34` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ResNet34'])
        model.set_state_dict(paddle.load(path))
L
lyuwenyu 已提交
154

L
lyuwenyu 已提交
155
    return model
L
lyuwenyu 已提交
156 157


L
lyuwenyu 已提交
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
def ResNet50(**kwargs):
    '''ResNet50
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _resnet.ResNet50(**kwargs)
    if pretrained:
        assert 'ResNet50' in _checkpoints, 'Not provide `ResNet50` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ResNet50'])
        model.set_state_dict(paddle.load(path))

    return model


def ResNet101(**kwargs):
    '''ResNet101
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _resnet.ResNet101(**kwargs)
    if pretrained:
        assert 'ResNet101' in _checkpoints, 'Not provide `ResNet101` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ResNet101'])
        model.set_state_dict(paddle.load(path))

    return model


def ResNet152(**kwargs):
    '''ResNet152
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _resnet.ResNet152(**kwargs)
    if pretrained:
        assert 'ResNet152' in _checkpoints, 'Not provide `ResNet152` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ResNet152'])
        model.set_state_dict(paddle.load(path))

    return model
L
lyuwenyu 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228



def SqueezeNet1_0(**kwargs):
    '''SqueezeNet1_0
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _squeezenet.SqueezeNet1_0(**kwargs)
    if pretrained:
        assert 'SqueezeNet1_0' in _checkpoints, 'Not provide `SqueezeNet1_0` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['SqueezeNet1_0'])
        model.set_state_dict(paddle.load(path))

    return model


def SqueezeNet1_1(**kwargs):
    '''SqueezeNet1_1
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _squeezenet.SqueezeNet1_1(**kwargs)
    if pretrained:
        assert 'SqueezeNet1_1' in _checkpoints, 'Not provide `SqueezeNet1_1` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['SqueezeNet1_1'])
        model.set_state_dict(paddle.load(path))

    return model


L
lyuwenyu 已提交
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300


def DenseNet121(**kwargs):
    '''DenseNet121
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _densenet.DenseNet121(**kwargs)
    if pretrained:
        assert 'DenseNet121' in _checkpoints, 'Not provide `DenseNet121` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['DenseNet121'])
        model.set_state_dict(paddle.load(path))

    return model


def DenseNet161(**kwargs):
    '''DenseNet161
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _densenet.DenseNet161(**kwargs)
    if pretrained:
        assert 'DenseNet161' in _checkpoints, 'Not provide `DenseNet161` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['DenseNet161'])
        model.set_state_dict(paddle.load(path))

    return model


def DenseNet169(**kwargs):
    '''DenseNet169
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _densenet.DenseNet169(**kwargs)
    if pretrained:
        assert 'DenseNet169' in _checkpoints, 'Not provide `DenseNet169` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['DenseNet169'])
        model.set_state_dict(paddle.load(path))

    return model


def DenseNet201(**kwargs):
    '''DenseNet201
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _densenet.DenseNet201(**kwargs)
    if pretrained:
        assert 'DenseNet201' in _checkpoints, 'Not provide `DenseNet201` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['DenseNet201'])
        model.set_state_dict(paddle.load(path))

    return model


def DenseNet264(**kwargs):
    '''DenseNet264
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _densenet.DenseNet264(**kwargs)
    if pretrained:
        assert 'DenseNet264' in _checkpoints, 'Not provide `DenseNet264` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['DenseNet264'])
        model.set_state_dict(paddle.load(path))

    return model


L
lyuwenyu 已提交
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326

def InceptionV3(**kwargs):
    '''InceptionV3
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _inception_v3.InceptionV3(**kwargs)
    if pretrained:
        assert 'InceptionV3' in _checkpoints, 'Not provide `InceptionV3` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['InceptionV3'])
        model.set_state_dict(paddle.load(path))

    return model


def InceptionV4(**kwargs):
    '''InceptionV4
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _inception_v4.InceptionV4(**kwargs)
    if pretrained:
        assert 'InceptionV4' in _checkpoints, 'Not provide `InceptionV4` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['InceptionV4'])
        model.set_state_dict(paddle.load(path))

L
lyuwenyu 已提交
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635
    return model



def GoogLeNet(**kwargs):
    '''GoogLeNet
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _googlenet.GoogLeNet(**kwargs)
    if pretrained:
        assert 'GoogLeNet' in _checkpoints, 'Not provide `GoogLeNet` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['GoogLeNet'])
        model.set_state_dict(paddle.load(path))

    return model



def ShuffleNet(**kwargs):
    '''ShuffleNet
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _shufflenet_v2.ShuffleNet(**kwargs)
    if pretrained:
        assert 'ShuffleNet' in _checkpoints, 'Not provide `ShuffleNet` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['ShuffleNet'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV1(**kwargs):
    '''MobileNetV1
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v1.MobileNetV1(**kwargs)
    if pretrained:
        assert 'MobileNetV1' in _checkpoints, 'Not provide `MobileNetV1` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV1'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV1_x0_25(**kwargs):
    '''MobileNetV1_x0_25
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v1.MobileNetV1_x0_25(**kwargs)
    if pretrained:
        assert 'MobileNetV1_x0_25' in _checkpoints, 'Not provide `MobileNetV1_x0_25` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV1_x0_25'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV1_x0_5(**kwargs):
    '''MobileNetV1_x0_5
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v1.MobileNetV1_x0_5(**kwargs)
    if pretrained:
        assert 'MobileNetV1_x0_5' in _checkpoints, 'Not provide `MobileNetV1_x0_5` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV1_x0_5'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV1_x0_75(**kwargs):
    '''MobileNetV1_x0_75
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v1.MobileNetV1_x0_75(**kwargs)
    if pretrained:
        assert 'MobileNetV1_x0_75' in _checkpoints, 'Not provide `MobileNetV1_x0_75` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV1_x0_75'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV2_x0_25(**kwargs):
    '''MobileNetV2_x0_25
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v2.MobileNetV2_x0_25(**kwargs)
    if pretrained:
        assert 'MobileNetV2_x0_25' in _checkpoints, 'Not provide `MobileNetV2_x0_25` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV2_x0_25'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV2_x0_5(**kwargs):
    '''MobileNetV2_x0_5
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v2.MobileNetV2_x0_5(**kwargs)
    if pretrained:
        assert 'MobileNetV2_x0_5' in _checkpoints, 'Not provide `MobileNetV2_x0_5` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV2_x0_5'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV2_x0_75(**kwargs):
    '''MobileNetV2_x0_75
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v2.MobileNetV2_x0_75(**kwargs)
    if pretrained:
        assert 'MobileNetV2_x0_75' in _checkpoints, 'Not provide `MobileNetV2_x0_75` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV2_x0_75'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV2_x1_5(**kwargs):
    '''MobileNetV2_x1_5
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v2.MobileNetV2_x1_5(**kwargs)
    if pretrained:
        assert 'MobileNetV2_x1_5' in _checkpoints, 'Not provide `MobileNetV2_x1_5` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV2_x1_5'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV2_x2_0(**kwargs):
    '''MobileNetV2_x2_0
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v2.MobileNetV2_x2_0(**kwargs)
    if pretrained:
        assert 'MobileNetV2_x2_0' in _checkpoints, 'Not provide `MobileNetV2_x2_0` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV2_x2_0'])
        model.set_state_dict(paddle.load(path))

    return model




def MobileNetV3_large_x0_35(**kwargs):
    '''MobileNetV3_large_x0_35
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_large_x0_35(**kwargs)
    if pretrained:
        assert 'MobileNetV3_large_x0_35' in _checkpoints, 'Not provide `MobileNetV3_large_x0_35` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_large_x0_35'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV3_large_x0_5(**kwargs):
    '''MobileNetV3_large_x0_5
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_large_x0_5(**kwargs)
    if pretrained:
        assert 'MobileNetV3_large_x0_5' in _checkpoints, 'Not provide `MobileNetV3_large_x0_5` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_large_x0_5'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_large_x0_75(**kwargs):
    '''MobileNetV3_large_x0_75
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_large_x0_75(**kwargs)
    if pretrained:
        assert 'MobileNetV3_large_x0_75' in _checkpoints, 'Not provide `MobileNetV3_large_x0_75` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_large_x0_75'])
        model.set_state_dict(paddle.load(path))

    return model


def MobileNetV3_large_x1_0(**kwargs):
    '''MobileNetV3_large_x1_0
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_large_x1_0(**kwargs)
    if pretrained:
        assert 'MobileNetV3_large_x1_0' in _checkpoints, 'Not provide `MobileNetV3_large_x1_0` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_large_x1_0'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_large_x1_25(**kwargs):
    '''MobileNetV3_large_x1_25
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_large_x1_25(**kwargs)
    if pretrained:
        assert 'MobileNetV3_large_x1_25' in _checkpoints, 'Not provide `MobileNetV3_large_x1_25` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_large_x1_25'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_small_x0_35(**kwargs):
    '''MobileNetV3_small_x0_35
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_small_x0_35(**kwargs)
    if pretrained:
        assert 'MobileNetV3_small_x0_35' in _checkpoints, 'Not provide `MobileNetV3_small_x0_35` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_small_x0_35'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_small_x0_5(**kwargs):
    '''MobileNetV3_small_x0_5
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_small_x0_5(**kwargs)
    if pretrained:
        assert 'MobileNetV3_small_x0_5' in _checkpoints, 'Not provide `MobileNetV3_small_x0_5` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_small_x0_5'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_small_x0_75(**kwargs):
    '''MobileNetV3_small_x0_75
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_small_x0_75(**kwargs)
    if pretrained:
        assert 'MobileNetV3_small_x0_75' in _checkpoints, 'Not provide `MobileNetV3_small_x0_75` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_small_x0_75'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_small_x1_0(**kwargs):
    '''MobileNetV3_small_x1_0
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_small_x1_0(**kwargs)
    if pretrained:
        assert 'MobileNetV3_small_x1_0' in _checkpoints, 'Not provide `MobileNetV3_small_x1_0` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_small_x1_0'])
        model.set_state_dict(paddle.load(path))

    return model



def MobileNetV3_small_x1_25(**kwargs):
    '''MobileNetV3_small_x1_25
    '''
    pretrained = kwargs.pop('pretrained', False)

    model = _mobilenet_v3.MobileNetV3_small_x1_25(**kwargs)
    if pretrained:
        assert 'MobileNetV3_small_x1_25' in _checkpoints, 'Not provide `MobileNetV3_small_x1_25` pretrained model.'
        path = paddle.utils.download.get_weights_path_from_url(_checkpoints['MobileNetV3_small_x1_25'])
        model.set_state_dict(paddle.load(path))

    return model