register.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # copyright (c) 2024 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. import os
  15. import os.path as osp
  16. from ...base.register import register_model_info, register_suite_info
  17. from .model import InstanceSegModel
  18. from .config import InstanceSegConfig
  19. from .runner import InstanceSegRunner
  20. REPO_ROOT_PATH = os.environ.get('PADDLE_PDX_PADDLEDETECTION_PATH')
  21. PDX_CONFIG_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', 'configs'))
  22. register_suite_info({
  23. 'suite_name': 'InstanceSeg',
  24. 'model': InstanceSegModel,
  25. 'runner': InstanceSegRunner,
  26. 'config': InstanceSegConfig,
  27. 'runner_root_path': REPO_ROOT_PATH
  28. })
  29. ################ Models Using Universal Config ################
  30. register_model_info({
  31. 'model_name': 'Mask-RT-DETR-L',
  32. 'suite': 'InstanceSeg',
  33. 'config_path': osp.join(PDX_CONFIG_DIR, 'Mask-RT-DETR-L.yaml'),
  34. 'supported_apis': ['train', 'evaluate', 'predict', 'export'],
  35. 'supported_dataset_types': ['COCOInstSegDataset'],
  36. 'supported_train_opts': {
  37. 'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
  38. 'dy2st': False,
  39. 'amp': ["OFF"]
  40. },
  41. })
  42. register_model_info({
  43. 'model_name': 'Mask-RT-DETR-H',
  44. 'suite': 'InstanceSeg',
  45. 'config_path': osp.join(PDX_CONFIG_DIR, 'Mask-RT-DETR-H.yaml'),
  46. 'supported_apis': ['train', 'evaluate', 'predict', 'export'],
  47. 'supported_dataset_types': ['COCOInstSegDataset'],
  48. 'supported_train_opts': {
  49. 'device': ['cpu', 'gpu_nxcx', 'xpu', 'npu', 'mlu'],
  50. 'dy2st': False,
  51. 'amp': ["OFF"]
  52. },
  53. })