clip-dinoiser / models /builder.py
ariG23498's picture
ariG23498 HF staff
check
d2ff88f
raw
history blame contribute delete
717 Bytes
# ------------------------------------------------------------------------------
# CLIP-DINOiser
# author: Monika Wysoczanska
# ------------------------------------------------------------------------------
# Modified from GroupViT (https://github.com/NVlabs/GroupViT)
# Copyright (c) 2021-22, NVIDIA Corporation & affiliates. All Rights Reserved.
# ------------------------------------------------------------------------------
from mmcv.utils import Registry
MODELS = Registry('models')
from omegaconf import OmegaConf
def build_model(config, class_names):
model = MODELS.build(OmegaConf.to_container(config, resolve=True),
default_args={'class_names': class_names})
return model