mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 06:10:50 +08:00
Change config_file path in uniformer and change the ckpts location since this is a standalone extension now
This commit is contained in:
parent
532f36d18e
commit
3f93c1ea9b
@ -15,9 +15,9 @@ def img_tensor_to_np(img_tensor):
|
||||
def common_annotator_call(annotator_callback, tensor_image, *args):
|
||||
call_result = annotator_callback(img_tensor_to_np(tensor_image), *args)
|
||||
if type(annotator_callback) is openpose.OpenposeDetector:
|
||||
return (HWC3(call_result[0]),call_result[1])
|
||||
return (HWC3(call_result[0]), call_result[1])
|
||||
if type(annotator_callback) is midas.MidasDetector():
|
||||
return (HWC3(call_result[0]),HWC3(call_result[1]))
|
||||
return (HWC3(call_result[0]), HWC3(call_result[1]))
|
||||
return HWC3(call_result)
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ class UniformerDetector:
|
||||
if not os.path.exists(modelpath):
|
||||
from basicsr.utils.download_util import load_file_from_url
|
||||
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()
|
||||
|
||||
def __call__(self, img):
|
||||
|
||||
@ -3,7 +3,7 @@ import cv2
|
||||
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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user