From 8c4f2bb95ec967108b97c223bef5dd5d437ce1d7 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Fri, 15 Aug 2025 12:31:50 +0300 Subject: [PATCH] Update pdf.py --- fantasyportrait/pdf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fantasyportrait/pdf.py b/fantasyportrait/pdf.py index 0de07c4..85fc0d5 100644 --- a/fantasyportrait/pdf.py +++ b/fantasyportrait/pdf.py @@ -4,6 +4,7 @@ import torch import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm +from ..utils import log def np_bgr_to_tensor(img_np, dtype): @@ -165,6 +166,8 @@ def det_landmarks(face_aligner, frame_list, comfy_pbar): )[-1] rect_list.append(face["face_rect"]) new_frame_list.append(frame) + else: + log.warning(f"No face detected in the frame {frame}, skipping.") pbar.set_description("DET stage1") pbar.update() comfy_pbar.update(1) @@ -185,6 +188,8 @@ def det_landmarks(face_aligner, frame_list, comfy_pbar): landmarks = face["pre_kpt_222"] save_frame_list.append(frame) save_landmark_list.append(landmarks) + else: + log.warning(f"No face detected in the frame {frame}, skipping.") pbar.set_description("DET stage2") pbar.update()