diff --git a/nodes/LivePortrait/animations/s0--d0.mp4 b/nodes/LivePortrait/animations/s0--d0.mp4 new file mode 100644 index 0000000..a50952c Binary files /dev/null and b/nodes/LivePortrait/animations/s0--d0.mp4 differ diff --git a/nodes/LivePortrait/animations/s0--d0_concat.mp4 b/nodes/LivePortrait/animations/s0--d0_concat.mp4 new file mode 100644 index 0000000..3c914a6 Binary files /dev/null and b/nodes/LivePortrait/animations/s0--d0_concat.mp4 differ diff --git a/nodes/LivePortrait/inference.py b/nodes/LivePortrait/inference.py index 036674d..478907d 100644 --- a/nodes/LivePortrait/inference.py +++ b/nodes/LivePortrait/inference.py @@ -15,9 +15,9 @@ current_directory = os.path.dirname(current_file_path) sys.path.append(current_directory) -# from src.config.argument_config import ArgumentConfig -# from src.config.inference_config import InferenceConfig -# from src.config.crop_config import CropConfig +from src.config.argument_config import ArgumentConfig +from src.config.inference_config import InferenceConfig +from src.config.crop_config import CropConfig from src.live_portrait_pipeline import LivePortraitPipeline @@ -81,7 +81,7 @@ def main(): checkpoint_G, checkpoint_W, checkpoint_S, - + mask_crop = None, flag_use_half_precision=True, flag_lip_zero=True, lip_zero_threshold=0.03, @@ -130,6 +130,7 @@ def main(): self.device_id = device_id self.flag_do_crop = flag_do_crop self.flag_do_rot = flag_do_rot + self.mask_crop=mask_crop args = ArgumentConfig( diff --git a/nodes/LivePortrait/src/utils/cropper.py b/nodes/LivePortrait/src/utils/cropper.py index 482b007..4331770 100644 --- a/nodes/LivePortrait/src/utils/cropper.py +++ b/nodes/LivePortrait/src/utils/cropper.py @@ -33,9 +33,10 @@ class Trajectory: class Cropper(object): def __init__(self, **kwargs) -> None: device_id = kwargs.get('device_id', 0) - landmark_runner_ckpt=kwargs.get('landmark_runner_ckpt', make_abs_path('../../pretrained_weights/liveportrait/landmark.onnx')) + landmark_runner_ckpt=kwargs.get('landmark_runner_ckpt', make_abs_path('../../pretrained_weights/liveportrait/landmark.onnx'))[0] - insightface_pretrained_weights=kwargs.get('insightface_pretrained_weights', make_abs_path('../../pretrained_weights/insightface')) + insightface_pretrained_weights=kwargs.get('insightface_pretrained_weights', make_abs_path('../../pretrained_weights/insightface'))[0] + print('#insightface_pretrained_weights',insightface_pretrained_weights) self.landmark_runner = LandmarkRunner( # ckpt_path=make_abs_path('../../pretrained_weights/liveportrait/landmark.onnx'), ckpt_path=landmark_runner_ckpt, diff --git a/nodes/LivePortrait/src/utils/landmark_runner.py b/nodes/LivePortrait/src/utils/landmark_runner.py index 470bccd..c4af1c2 100644 --- a/nodes/LivePortrait/src/utils/landmark_runner.py +++ b/nodes/LivePortrait/src/utils/landmark_runner.py @@ -31,7 +31,7 @@ class LandmarkRunner(object): device_id = kwargs.get('device_id', 0) self.dsize = kwargs.get('dsize', 224) self.timer = Timer() - print('#onnx_provider',onnx_provider,device_id,ckpt_path) + # print('#onnx_provider',onnx_provider,device_id,ckpt_path) if onnx_provider.lower() == 'cuda': self.session = onnxruntime.InferenceSession( ckpt_path, providers=[ diff --git a/nodes/LivePortrait/src/utils/resources/mask_template.png b/nodes/LivePortrait/src/utils/resources/mask_template.png new file mode 100644 index 0000000..bca6ca5 Binary files /dev/null and b/nodes/LivePortrait/src/utils/resources/mask_template.png differ