Minor fixes

This commit is contained in:
henryruhs 2023-07-30 21:38:03 +02:00
parent 7cacbddb1f
commit 5625dc12d5
4 changed files with 11 additions and 11 deletions

View File

@ -84,16 +84,16 @@ def process_frame(source_face: Face, reference_face: Face, temp_frame: Frame) ->
def process_frames(source_path: str, temp_frame_paths: List[str], update: Callable[[], None]) -> None:
for temp_frame_path in temp_frame_paths:
temp_frame = cv2.imread(temp_frame_path)
result = process_frame(None, None, temp_frame)
cv2.imwrite(temp_frame_path, result)
result_frame = process_frame(None, None, temp_frame)
cv2.imwrite(temp_frame_path, result_frame)
if update:
update()
def process_image(source_path: str, target_path: str, output_path: str) -> None:
target_frame = cv2.imread(target_path)
result = process_frame(None, None, target_frame)
cv2.imwrite(output_path, result)
result_frame = process_frame(None, None, target_frame)
cv2.imwrite(output_path, result_frame)
def process_video(source_path: str, temp_frame_paths: List[str]) -> None:

View File

@ -78,8 +78,8 @@ def process_frames(source_path: str, temp_frame_paths: List[str], update: Callab
reference_face = get_face_reference() if not roop.globals.many_faces else None
for temp_frame_path in temp_frame_paths:
temp_frame = cv2.imread(temp_frame_path)
result = process_frame(source_face, reference_face, temp_frame)
cv2.imwrite(temp_frame_path, result)
result_frame = process_frame(source_face, reference_face, temp_frame)
cv2.imwrite(temp_frame_path, result_frame)
if update:
update()
@ -88,8 +88,8 @@ def process_image(source_path: str, target_path: str, output_path: str) -> None:
source_face = get_one_face(cv2.imread(source_path))
target_frame = cv2.imread(target_path)
reference_face = get_one_face(target_frame, roop.globals.reference_face_position) if not roop.globals.many_faces else None
result = process_frame(source_face, reference_face, target_frame)
cv2.imwrite(output_path, result)
result_frame = process_frame(source_face, reference_face, target_frame)
cv2.imwrite(output_path, result_frame)
def process_video(source_path: str, temp_frame_paths: List[str]) -> None:

View File

@ -73,8 +73,8 @@ def process_frame(source_face: Face, reference_face: Face, temp_frame: Frame) ->
def process_frames(source_path: str, temp_frame_paths: List[str], update: Callable[[], None]) -> None:
for temp_frame_path in temp_frame_paths:
temp_frame = cv2.imread(temp_frame_path)
result = process_frame(None, None, temp_frame)
cv2.imwrite(temp_frame_path, result)
result_frame = process_frame(None, None, temp_frame)
cv2.imwrite(temp_frame_path, result_frame)
if update:
update()

View File

@ -12,7 +12,7 @@ def render() -> None:
with gradio.Box():
frame_processors_checkbox_group = gradio.CheckboxGroup(
label='frame_processors',
choices=list_frame_processors_names(),
choices=sort_frame_processors(roop.globals.frame_processors),
value=roop.globals.frame_processors
)
ui.register_component('frame_processors_checkbox_group', frame_processors_checkbox_group)