Browse Source

some model lack 'hub_conf.py' file at model_zoo

pull/15848/head
dinglinhe 4 years ago
parent
commit
e99ffb0223
18 changed files with 382 additions and 3 deletions
  1. +25
    -0
      model_zoo/official/cv/centerface/mindspore_hub_conf.py
  2. +25
    -0
      model_zoo/official/cv/cnnctc/mindspore_hub_conf.py
  3. +25
    -0
      model_zoo/official/cv/efficientnet/mindspore_hub_conf.py
  4. +25
    -0
      model_zoo/official/cv/inceptionv4/mindspore_hub_conf.py
  5. +0
    -0
      model_zoo/official/cv/inceptionv4/src/__init__.py
  6. +25
    -0
      model_zoo/official/cv/mobilenetv1/mindspore_hub_conf.py
  7. +25
    -0
      model_zoo/official/cv/openpose/mindspore_hub_conf.py
  8. +25
    -0
      model_zoo/official/cv/shufflenetv1/mindspore_hub_conf.py
  9. +25
    -0
      model_zoo/official/cv/shufflenetv2/mindspore_hub_conf.py
  10. +25
    -0
      model_zoo/official/cv/squeezenet/mindspore_hub_conf.py
  11. +25
    -0
      model_zoo/official/cv/xception/mindspore_hub_conf.py
  12. +25
    -0
      model_zoo/official/nlp/fasttext/mindspore_hub_conf.py
  13. +3
    -1
      model_zoo/official/nlp/mass/src/__init__.py
  14. +4
    -2
      model_zoo/official/nlp/mass/src/transformer/__init__.py
  15. +25
    -0
      model_zoo/official/nlp/textcnn/mindspore_hub_conf.py
  16. +25
    -0
      model_zoo/official/recommend/ncf/mindspore_hub_conf.py
  17. +25
    -0
      model_zoo/research/audio/fcn-4/mindspore_hub_conf.py
  18. +25
    -0
      model_zoo/research/nlp/textrcnn/mindspore_hub_conf.py

+ 25
- 0
model_zoo/official/cv/centerface/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.centerface import CenterfaceMobilev2

def centerface(*args, **kwargs):
return CenterfaceMobilev2(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "centerface":
return CenterfaceMobilev2(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/cnnctc/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.cnn_ctc import CNNCTC_Model

def cnnctc(*args, **kwargs):
return CNNCTC_Model(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "cnnctc":
return CNNCTC_Model(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/efficientnet/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.efficientnet import efficientnet_b0

def efficinetnet(*args, **kwargs):
return efficientnet_b0(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "efficinetnet":
return efficientnet_b0(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/inceptionv4/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.inceptionv4 import Inceptionv4

def inceptionv4_net(*args, **kwargs):
return Inceptionv4(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "inceptionv4":
return Inceptionv4(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 0
- 0
model_zoo/official/cv/inceptionv4/src/__init__.py View File


+ 25
- 0
model_zoo/official/cv/mobilenetv1/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.mobilenet_v1 import mobilenet_v1

def mobilenetv1(*args, **kwargs):
return mobilenet_v1(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "mobilenetv1":
return mobilenet_v1(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/openpose/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.openposenet import OpenPoseNet

def openposenet(*args, **kwargs):
return OpenPoseNet(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "openposenet":
return OpenPoseNet(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/shufflenetv1/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.shufflenetv1 import ShuffleNetV1

def shufflenetv1(*args, **kwargs):
return ShuffleNetV1(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "shufflenetv1":
return ShuffleNetV1(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/shufflenetv2/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.shufflenetv2 import ShuffleNetV2

def shufflenetv2(*args, **kwargs):
return ShuffleNetV2(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "shufflenetv2":
return ShuffleNetV2(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/squeezenet/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.squeezenet import SqueezeNet

def squeezenet(*args, **kwargs):
return SqueezeNet(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "squeezenet":
return SqueezeNet(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/cv/xception/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.Xception import xception

def xceptionnet(*args, **kwargs):
return xception(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "xception":
return xception(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/nlp/fasttext/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.fasttext_model import FastText

def fasttext(*args, **kwargs):
return FastText(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "fasttext":
return FastText(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 3
- 1
model_zoo/official/nlp/mass/src/__init__.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ from .transformer import LabelSmoothedCrossEntropyCriterion
from .transformer import TransformerTrainOneStepWithLossScaleCell
from .transformer import TransformerTraining
from .transformer import infer
from .transformer import TransformerInferModel
from .language_model import LooseMaskedLanguageModel
from .language_model import MaskedLanguageModel
from .language_model import NoiseChannelLanguageModel
@@ -40,5 +41,6 @@ __all__ = [
"LabelSmoothedCrossEntropyCriterion",
"LooseMaskedLanguageModel",
"MaskedLanguageModel",
"TransformerInferModel",
"NoiseChannelLanguageModel"
]

+ 4
- 2
model_zoo/official/nlp/mass/src/transformer/__init__.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ from .beam_search import BeamSearchDecoder
from .transformer_for_train import TransformerTraining, LabelSmoothedCrossEntropyCriterion, \
TransformerNetworkWithLoss, TransformerTrainOneStepWithLossScaleCell
from .infer_mass import infer, infer_ppl
from .transformer_for_infer import TransformerInferModel

__all__ = [
"infer",
@@ -31,5 +32,6 @@ __all__ = [
"Transformer",
"TransformerEncoder",
"TransformerDecoder",
"BeamSearchDecoder"
"BeamSearchDecoder",
"TransformerInferModel"
]

+ 25
- 0
model_zoo/official/nlp/textcnn/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.textcnn import TextCNN

def textcnn_net(*args, **kwargs):
return TextCNN(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "textcnn":
return TextCNN(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/official/recommend/ncf/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.ncf import NCFModel

def ncfnet(*args, **kwargs):
return NCFModel(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "ncf":
return NCFModel(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/research/audio/fcn-4/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.musictagger import MusicTaggerCNN

def fcn_4(*args, **kwargs):
return MusicTaggerCNN(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "fcn4":
return MusicTaggerCNN(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

+ 25
- 0
model_zoo/research/nlp/textrcnn/mindspore_hub_conf.py View File

@@ -0,0 +1,25 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""hub config"""
from src.textrcnn import textrcnn

def textrcnn_net(*args, **kwargs):
return textrcnn(*args, **kwargs)


def create_network(name, *args, **kwargs):
if name == "textrcnn":
return textrcnn(*args, **kwargs)
raise NotImplementedError(f"{name} is not implemented in the repo")

Loading…
Cancel
Save