From f86c8ca213728415d2a4175e503fa36e639b3e76 Mon Sep 17 00:00:00 2001 From: gengdongjie Date: Tue, 22 Sep 2020 22:44:22 +0800 Subject: [PATCH] add hub config for warpctc and maskrcnn --- model_zoo/official/cv/maskrcnn/README.md | 1 + .../cv/maskrcnn/mindspore_hub_conf.py | 22 +++++++++++++++++++ model_zoo/official/cv/warpctc/README.md | 1 + .../official/cv/warpctc/mindspore_hub_conf.py | 21 ++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 model_zoo/official/cv/maskrcnn/mindspore_hub_conf.py create mode 100644 model_zoo/official/cv/warpctc/mindspore_hub_conf.py diff --git a/model_zoo/official/cv/maskrcnn/README.md b/model_zoo/official/cv/maskrcnn/README.md index 4aa20c02b12..08e75e325ae 100644 --- a/model_zoo/official/cv/maskrcnn/README.md +++ b/model_zoo/official/cv/maskrcnn/README.md @@ -140,6 +140,7 @@ pip install mmcv=0.2.14 ├─lr_schedule.py # leanring rate geneatore ├─network_define.py # network define for maskrcnn └─util.py # routine operation + ├─mindspore_hub_conf.py # mindspore hub interface ├─eval.py # evaluation scripts └─train.py # training scripts ``` diff --git a/model_zoo/official/cv/maskrcnn/mindspore_hub_conf.py b/model_zoo/official/cv/maskrcnn/mindspore_hub_conf.py new file mode 100644 index 00000000000..a69fd05a168 --- /dev/null +++ b/model_zoo/official/cv/maskrcnn/mindspore_hub_conf.py @@ -0,0 +1,22 @@ +# Copyright 2020 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.maskrcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50 +from src.config import config + +def create_network(name, *args, **kwargs): + if name == "maskrcnn": + return Mask_Rcnn_Resnet50(config=config) + raise NotImplementedError(f"{name} is not implemented in the repo") diff --git a/model_zoo/official/cv/warpctc/README.md b/model_zoo/official/cv/warpctc/README.md index fe25661d928..debf260c611 100644 --- a/model_zoo/official/cv/warpctc/README.md +++ b/model_zoo/official/cv/warpctc/README.md @@ -118,6 +118,7 @@ The dataset is self-generated using a third-party library called [captcha](https ├── metric.py # accuracy metric for warpctc network ├── warpctc.py # warpctc network definition └── warpctc_for_train.py # warpctc network with grad, loss and gradient clip + ├── mindspore_hub_conf.py # mindspore hub interface ├── eval.py # eval net ├── process_data.py # dataset generation script └── train.py # train net diff --git a/model_zoo/official/cv/warpctc/mindspore_hub_conf.py b/model_zoo/official/cv/warpctc/mindspore_hub_conf.py new file mode 100644 index 00000000000..bafba795467 --- /dev/null +++ b/model_zoo/official/cv/warpctc/mindspore_hub_conf.py @@ -0,0 +1,21 @@ +# Copyright 2020 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.warpctc import StackedRNN + +def create_network(name, *args, **kwargs): + if name == "warpctc": + return StackedRNN(*args, **kwargs) + raise NotImplementedError(f"{name} is not implemented in the repo")