from . import get_config
import importlib


def get_detector(name: str, is_vfs: bool=False):
    config = get_config(r"config.json", is_vfs)
    model_map = config["model_map"]
    model = importlib.import_module(model_map[name]["module"])
    model_config = get_config(model_map[name]["config"], is_vfs)
    detector_class = getattr(model, "Detector")
    return detector_class, model_config
