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'
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:
start_x, start_y, end_x, end_y = map(int, target_face['bbox'])
with THREAD_SEMAPHORE:
_, _, temp_face = get_face_enhancer().enhance(
temp_frame[start_y:end_y, start_x:end_x],
paste_back=True
)
temp_frame[start_y:end_y, start_x:end_x] = temp_face
temp_face = temp_frame[start_y:end_y, start_x:end_x]
if temp_face.size:
with THREAD_SEMAPHORE:
_, _, temp_face = get_face_enhancer().enhance(
temp_face,
paste_back=True
)
temp_frame[start_y:end_y, start_x:end_x] = temp_face
return temp_frame