builder.py 657 B

1234567891011121314151617181920212223
  1. # -------------------------------------------------------------------------
  2. # Copyright (c) 2021-2022, NVIDIA Corporation & Affiliates. All rights reserved.
  3. #
  4. # This work is made available under the Nvidia Source Code License.
  5. # To view a copy of this license, visit
  6. # https://github.com/NVlabs/GroupViT/blob/main/LICENSE
  7. #
  8. # Written by Jiarui Xu
  9. # -------------------------------------------------------------------------
  10. from mmcv.utils import Registry
  11. from omegaconf import OmegaConf
  12. MODELS = Registry('model')
  13. def build_model(config):
  14. model = MODELS.build(OmegaConf.to_container(config, resolve=True))
  15. # print(model)
  16. return model