def __init__(self, config_path=None, weight_path=None, model_name=None):
    if (config_path is None):
        config_path = 'tool/config/detection/configs.yaml'
    config = Config(config_path)
    self.model_name = model_name
    if (weight_path is None):
        if (self.model_name is None):
            self.model_name = 'pan_resnet18_default'
        tmp_path = os.path.join(CACHE_DIR, f'{self.model_name}.pth')
        download_pretrained_weights(self.model_name, cached=tmp_path)
        weight_path = tmp_path
    self.model = detection.PAN(config, model_path=weight_path)
def __init__(self, config_path=None, weight_path=None, model_name=None):
    if (config_path is None):
        config_path = 'tool/config/detection/configs.yaml'
    config = Config(config_path)
    self.model_name = model_name
    if (weight_path is None):
        if (self.model_name is None):
            self.model_name = 'pan_resnet18_default'
        tmp_path = os.path.join(CACHE_DIR, f'{self.model_name}.pth')
        download_pretrained_weights(self.model_name, cached=tmp_path)
        weight_path = tmp_path
    self.model = detection.PAN(config, model_path=weight_path)