diff --git a/model_zoo/official/cv/maskrcnn/README.md b/model_zoo/official/cv/maskrcnn/README.md index fadce5ad32..5e70c41f70 100644 --- a/model_zoo/official/cv/maskrcnn/README.md +++ b/model_zoo/official/cv/maskrcnn/README.md @@ -50,7 +50,7 @@ MaskRcnn is a two-stage target detection network,This network uses a region prop ```shell . -└─MaskRcnn +└─maskrcnn ├─README.md ├─scripts ├─run_download_process_data.sh @@ -58,7 +58,7 @@ MaskRcnn is a two-stage target detection network,This network uses a region prop ├─run_train.sh └─run_eval.sh ├─src - ├─MaskRcnn + ├─maskrcnn ├─__init__.py ├─anchor_generator.py ├─bbox_assign_sample.py diff --git a/model_zoo/official/cv/maskrcnn/eval.py b/model_zoo/official/cv/maskrcnn/eval.py index 36289e6480..d4179b2d11 100644 --- a/model_zoo/official/cv/maskrcnn/eval.py +++ b/model_zoo/official/cv/maskrcnn/eval.py @@ -24,7 +24,7 @@ from mindspore import context, Tensor from mindspore.train.serialization import load_checkpoint, load_param_into_net import mindspore.dataset.engine as de -from src.MaskRcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50 +from src.maskrcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50 from src.config import config from src.dataset import data_to_mindrecord_byte_image, create_maskrcnn_dataset from src.util import coco_eval, bbox2result_1image, results2json, get_seg_masks diff --git a/model_zoo/official/cv/maskrcnn/src/config.py b/model_zoo/official/cv/maskrcnn/src/config.py index e1bf13c891..fd93dc7cff 100644 --- a/model_zoo/official/cv/maskrcnn/src/config.py +++ b/model_zoo/official/cv/maskrcnn/src/config.py @@ -141,8 +141,8 @@ config = ed({ "keep_checkpoint_max": 12, "save_checkpoint_path": "./checkpoint", - "mindrecord_dir": "/home/mxw/mask_rcnn/scripts/MindRecord_COCO2017_Train", - "coco_root": "/home/mxw/coco2017/", + "mindrecord_dir": "/home/mask_rcnn/MindRecord_COCO2017_Train", + "coco_root": "/home/mask_rcnn/coco2017/", "train_data_type": "train2017", "val_data_type": "val2017", "instance_set": "annotations/instances_{}.json", diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/__init__.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/__init__.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/__init__.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/__init__.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/anchor_generator.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/anchor_generator.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/anchor_generator.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/anchor_generator.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/bbox_assign_sample.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/bbox_assign_sample.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/bbox_assign_sample.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/bbox_assign_sample.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/bbox_assign_sample_stage2.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/bbox_assign_sample_stage2.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/bbox_assign_sample_stage2.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/bbox_assign_sample_stage2.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/fpn_neck.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/fpn_neck.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/fpn_neck.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/fpn_neck.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/mask_rcnn_r50.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/mask_rcnn_r50.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/mask_rcnn_r50.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/mask_rcnn_r50.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/proposal_generator.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/proposal_generator.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/proposal_generator.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/proposal_generator.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/rcnn_cls.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/rcnn_cls.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/rcnn_cls.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/rcnn_cls.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/rcnn_mask.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/rcnn_mask.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/rcnn_mask.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/rcnn_mask.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/resnet50.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/resnet50.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/resnet50.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/resnet50.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/roi_align.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/roi_align.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/roi_align.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/roi_align.py diff --git a/model_zoo/official/cv/maskrcnn/src/MaskRcnn/rpn.py b/model_zoo/official/cv/maskrcnn/src/maskrcnn/rpn.py similarity index 100% rename from model_zoo/official/cv/maskrcnn/src/MaskRcnn/rpn.py rename to model_zoo/official/cv/maskrcnn/src/maskrcnn/rpn.py diff --git a/model_zoo/official/cv/maskrcnn/train.py b/model_zoo/official/cv/maskrcnn/train.py index 06c5e87b4c..e781648a37 100644 --- a/model_zoo/official/cv/maskrcnn/train.py +++ b/model_zoo/official/cv/maskrcnn/train.py @@ -18,6 +18,7 @@ import os import argparse import random +import ast import numpy as np import mindspore.common.dtype as mstype @@ -30,7 +31,7 @@ from mindspore.train.serialization import load_checkpoint, load_param_into_net from mindspore.nn import SGD import mindspore.dataset.engine as de -from src.MaskRcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50 +from src.maskrcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50 from src.network_define import LossCallBack, WithLossCell, TrainOneStepCell, LossNet from src.config import config from src.dataset import data_to_mindrecord_byte_image, create_maskrcnn_dataset @@ -41,11 +42,11 @@ np.random.seed(1) de.config.set_seed(1) parser = argparse.ArgumentParser(description="MaskRcnn training") -parser.add_argument("--only_create_dataset", type=bool, default=False, help="If set it true, only create " - "Mindrecord, default is false.") -parser.add_argument("--run_distribute", type=bool, default=False, help="Run distribute, default is false.") -parser.add_argument("--do_train", type=bool, default=True, help="Do train or not, default is true.") -parser.add_argument("--do_eval", type=bool, default=False, help="Do eval or not, default is false.") +parser.add_argument("--only_create_dataset", type=ast.literal_eval, default=False, help="If set it true, only create " + "Mindrecord, default is false.") +parser.add_argument("--run_distribute", type=ast.literal_eval, default=False, help="Run distribute, default is false.") +parser.add_argument("--do_train", type=ast.literal_eval, default=True, help="Do train or not, default is true.") +parser.add_argument("--do_eval", type=ast.literal_eval, default=False, help="Do eval or not, default is false.") parser.add_argument("--dataset", type=str, default="coco", help="Dataset, default is coco.") parser.add_argument("--pre_trained", type=str, default="", help="Pretrain file path.") parser.add_argument("--device_id", type=int, default=0, help="Device id, default is 0.")