fixed slow landmarks onnx

This commit is contained in:
David Chatel
2025-10-08 13:48:42 +02:00
parent bfcff74d39
commit 59566c54f4
+2 -2
View File
@@ -8,7 +8,7 @@ from scipy.spatial import ConvexHull
from folder_paths import models_dir
from .BiSeNet import BiSeNet
from ultralytics import YOLO
from onnxruntime import InferenceSession, get_available_providers
from onnxruntime import InferenceSession
from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
from skimage import transform as trans
@@ -62,7 +62,7 @@ class Models:
@classmethod
def lmk(cls, crop):
if '_lmk' not in cls.__dict__:
cls._lmk = InferenceSession(os.path.join(models_dir, 'landmarks', 'fan2_68_landmark.onnx'))
cls._lmk = InferenceSession(os.path.join(models_dir, 'landmarks', 'fan2_68_landmark.onnx'), providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
lmk = cls._lmk.run(None, {'input': crop})[0]
return lmk