Change config_file path in uniformer and change the ckpts location since this is a standalone extension now

This commit is contained in:
Hacker 17082006 2023-02-23 09:42:42 +07:00
parent 532f36d18e
commit 3f93c1ea9b
3 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ class UniformerDetector:
if not os.path.exists(modelpath): if not os.path.exists(modelpath):
from basicsr.utils.download_util import load_file_from_url from basicsr.utils.download_util import load_file_from_url
load_file_from_url(checkpoint_file, model_dir=annotator_ckpts_path) load_file_from_url(checkpoint_file, model_dir=annotator_ckpts_path)
config_file = os.path.join(os.path.dirname(annotator_ckpts_path).replace("models", "custom_nodes/annotator"), "uniformer", "exp", "upernet_global_small", "config.py") config_file = os.path.join(os.path.dirname(__file__), "exp", "upernet_global_small", "config.py")
self.model = init_segmentor(config_file, modelpath).cuda() self.model = init_segmentor(config_file, modelpath).cuda()
def __call__(self, img): def __call__(self, img):

View File

@ -3,7 +3,7 @@ import cv2
import os import os
annotator_ckpts_path = os.path.join(os.path.dirname(__file__), "../../models/annotators") annotator_ckpts_path = os.path.join(os.path.dirname(__file__), "ckpts")
def HWC3(x): def HWC3(x):