Hotfix enhancer as of empty bbox

This commit is contained in:
henryruhs
2023-07-20 12:46:48 +02:00
parent df731fcef1
commit 75c8f58355
2 changed files with 9 additions and 7 deletions

View File

@@ -1,2 +1,2 @@
name = 'roop' name = 'roop'
version = '1.2.0' version = '1.2.1'

View File

@@ -60,12 +60,14 @@ def post_process() -> None:
def enhance_face(target_face: Face, temp_frame: Frame) -> Frame: def enhance_face(target_face: Face, temp_frame: Frame) -> Frame:
start_x, start_y, end_x, end_y = map(int, target_face['bbox']) start_x, start_y, end_x, end_y = map(int, target_face['bbox'])
with THREAD_SEMAPHORE: temp_face = temp_frame[start_y:end_y, start_x:end_x]
_, _, temp_face = get_face_enhancer().enhance( if temp_face.size:
temp_frame[start_y:end_y, start_x:end_x], with THREAD_SEMAPHORE:
paste_back=True _, _, temp_face = get_face_enhancer().enhance(
) temp_face,
temp_frame[start_y:end_y, start_x:end_x] = temp_face paste_back=True
)
temp_frame[start_y:end_y, start_x:end_x] = temp_face
return temp_frame return temp_frame