__init__.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from .resnet import ResNet
  15. from .darknet import DarkNet
  16. from .detection import FasterRCNN
  17. from .mobilenet_v1 import MobileNetV1
  18. from .mobilenet_v2 import MobileNetV2
  19. from .mobilenet_v3 import MobileNetV3
  20. from .segmentation import UNet
  21. from .segmentation import DeepLabv3p
  22. from .xception import Xception
  23. from .densenet import DenseNet
  24. from .shufflenet_v2 import ShuffleNetV2
  25. def resnet18(input, num_classes=1000):
  26. model = ResNet(layers=18, num_classes=num_classes)
  27. return model(input)
  28. def resnet34(input, num_classes=1000):
  29. model = ResNet(layers=34, num_classes=num_classes)
  30. return model(input)
  31. def resnet50(input, num_classes=1000):
  32. model = ResNet(layers=50, num_classes=num_classes)
  33. return model(input)
  34. def resnet101(input, num_classes=1000):
  35. model = ResNet(layers=101, num_classes=num_classes)
  36. return model(input)
  37. def resnet50_vd(input, num_classes=1000):
  38. model = ResNet(layers=50, num_classes=num_classes, variant='d')
  39. return model(input)
  40. def resnet101_vd(input, num_classes=1000):
  41. model = ResNet(layers=101, num_classes=num_classes, variant='d')
  42. return model(input)
  43. def darknet53(input, num_classes=1000):
  44. model = DarkNet(depth=53, num_classes=num_classes, bn_act='relu')
  45. return model(input)
  46. def mobilenetv1(input, num_classes=1000):
  47. model = MobileNetV1(num_classes=num_classes)
  48. return model(input)
  49. def mobilenetv2(input, num_classes=1000):
  50. model = MobileNetV2(num_classes=num_classes)
  51. return model(input)
  52. def mobilenetv3_small(input, num_classes=1000):
  53. model = MobileNetV3(num_classes=num_classes, model_name='small')
  54. return model(input)
  55. def mobilenetv3_large(input, num_classes=1000):
  56. model = MobileNetV3(num_classes=num_classes, model_name='large')
  57. return model(input)
  58. def xception65(input, num_classes=1000):
  59. model = Xception(layers=65, num_classes=num_classes)
  60. return model(input)
  61. def xception71(input, num_classes=1000):
  62. model = Xception(layers=71, num_classes=num_classes)
  63. return model(input)
  64. def xception41(input, num_classes=1000):
  65. model = Xception(layers=41, num_classes=num_classes)
  66. return model(input)
  67. def densenet121(input, num_classes=1000):
  68. model = DenseNet(layers=121, num_classes=num_classes)
  69. return model(input)
  70. def densenet161(input, num_classes=1000):
  71. model = DenseNet(layers=161, num_classes=num_classes)
  72. return model(input)
  73. def densenet201(input, num_classes=1000):
  74. model = DenseNet(layers=201, num_classes=num_classes)
  75. return model(input)
  76. def shufflenetv2(input, num_classes=1000):
  77. model = ShuffleNetV2(num_classes=num_classes)
  78. return model(input)