register.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 ShiTuRecModel
  18. from .runner import ShiTuRecRunner
  19. from .config import ShiTuRecConfig
  20. REPO_ROOT_PATH = os.environ.get("PADDLE_PDX_PADDLECLAS_PATH")
  21. PDX_CONFIG_DIR = osp.abspath(osp.join(osp.dirname(__file__), "..", "configs"))
  22. register_suite_info(
  23. {
  24. "suite_name": "ShiTuRec",
  25. "model": ShiTuRecModel,
  26. "runner": ShiTuRecRunner,
  27. "config": ShiTuRecConfig,
  28. "runner_root_path": REPO_ROOT_PATH,
  29. }
  30. )
  31. ################ Models Using Universal Config ################
  32. register_model_info(
  33. {
  34. "model_name": "PP-ShiTuV2_rec",
  35. "suite": "ShiTuRec",
  36. "config_path": osp.join(PDX_CONFIG_DIR, "PP-ShiTuV2_rec.yaml"),
  37. "supported_apis": ["train", "evaluate", "predict", "export"],
  38. "supported_dataset_types": ["ShiTuRecDataset"],
  39. "infer_config": None,
  40. }
  41. )
  42. register_model_info(
  43. {
  44. "model_name": "PP-ShiTuV2_rec_CLIP_vit_base",
  45. "suite": "ShiTuRec",
  46. "config_path": osp.join(PDX_CONFIG_DIR, "PP-ShiTuV2_rec_CLIP_vit_base.yaml"),
  47. "supported_apis": ["train", "evaluate", "predict", "export"],
  48. "supported_dataset_types": ["ShiTuRecDataset"],
  49. "infer_config": None,
  50. }
  51. )
  52. register_model_info(
  53. {
  54. "model_name": "PP-ShiTuV2_rec_CLIP_vit_large",
  55. "suite": "ShiTuRec",
  56. "config_path": osp.join(PDX_CONFIG_DIR, "PP-ShiTuV2_rec_CLIP_vit_large.yaml"),
  57. "supported_apis": ["train", "evaluate", "predict", "export"],
  58. "supported_dataset_types": ["ShiTuRecDataset"],
  59. "infer_config": None,
  60. }
  61. )