| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- # copyright (c) 2024 PaddlePaddle Authors. All Rights Reserve.
- #
- # 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.
- import os
- import os.path as osp
- from pathlib import Path
- from ...base.register import register_model_info, register_suite_info
- from .model import InstanceSegModel
- from .config import InstanceSegConfig
- from .runner import InstanceSegRunner
- REPO_ROOT_PATH = os.environ.get("PADDLE_PDX_PADDLEDETECTION_PATH")
- PDX_CONFIG_DIR = osp.abspath(osp.join(osp.dirname(__file__), "..", "configs"))
- HPI_CONFIG_DIR = Path(__file__).parent.parent.parent.parent / "utils" / "hpi_configs"
- register_suite_info(
- {
- "suite_name": "InstanceSeg",
- "model": InstanceSegModel,
- "runner": InstanceSegRunner,
- "config": InstanceSegConfig,
- "runner_root_path": REPO_ROOT_PATH,
- }
- )
- ################ Models Using Universal Config ################
- register_model_info(
- {
- "model_name": "Mask-RT-DETR-S",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Mask-RT-DETR-S.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "Mask-RT-DETR-M",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Mask-RT-DETR-M.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "Mask-RT-DETR-L",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Mask-RT-DETR-L.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- "hpi_config_path": HPI_CONFIG_DIR / "Mask-RT-DETR-L.yaml",
- }
- )
- register_model_info(
- {
- "model_name": "Mask-RT-DETR-X",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Mask-RT-DETR-X.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "Mask-RT-DETR-H",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Mask-RT-DETR-H.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- "hpi_config_path": HPI_CONFIG_DIR / "Mask-RT-DETR-H.yaml",
- }
- )
- register_model_info(
- {
- "model_name": "SOLOv2",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "SOLOv2.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet50",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet50.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet50-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet50-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet50-vd-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet50-vd-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet50-vd-SSLDv2-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet50-vd-SSLDv2-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet101-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet101-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNet101-vd-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNet101-vd-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "MaskRCNN-ResNeXt101-vd-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "MaskRCNN-ResNeXt101-vd-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "Cascade-MaskRCNN-ResNet50-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "Cascade-MaskRCNN-ResNet50-FPN.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "Cascade-MaskRCNN-ResNet50-vd-SSLDv2-FPN",
- "suite": "InstanceSeg",
- "config_path": osp.join(
- PDX_CONFIG_DIR, "Cascade-MaskRCNN-ResNet50-vd-SSLDv2-FPN.yaml"
- ),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
- register_model_info(
- {
- "model_name": "PP-YOLOE_seg-S",
- "suite": "InstanceSeg",
- "config_path": osp.join(PDX_CONFIG_DIR, "PP-YOLOE_seg-S.yaml"),
- "supported_apis": ["train", "evaluate", "predict", "export"],
- "supported_dataset_types": ["COCOInstSegDataset"],
- "supported_train_opts": {
- "device": ["cpu", "gpu_nxcx", "xpu", "npu", "mlu"],
- "dy2st": False,
- "amp": ["OFF"],
- },
- }
- )
|