jhj0517
commited on
Commit
·
8db15a4
1
Parent(s):
222faf4
Fix np shape
Browse files
modules/live_portrait/live_portrait_inferencer.py
CHANGED
@@ -529,9 +529,11 @@ class LivePortraitInferencer:
|
|
529 |
return face_img
|
530 |
|
531 |
def prepare_source(self, source_image, crop_factor, is_video=False, tracking=False):
|
532 |
-
|
533 |
-
#source_image_np = (source_image * 255).byte().numpy()
|
534 |
# img_rgb = source_image_np[0]
|
|
|
|
|
|
|
535 |
|
536 |
psi_list = []
|
537 |
for img_rgb in source_image:
|
|
|
529 |
return face_img
|
530 |
|
531 |
def prepare_source(self, source_image, crop_factor, is_video=False, tracking=False):
|
532 |
+
# source_image_np = (source_image * 255).byte().numpy()
|
|
|
533 |
# img_rgb = source_image_np[0]
|
534 |
+
print("Prepare source...")
|
535 |
+
if len(source_image.shape) <= 3:
|
536 |
+
source_image = source_image[np.newaxis, ...]
|
537 |
|
538 |
psi_list = []
|
539 |
for img_rgb in source_image:
|