mirror of
https://github.com/s0md3v/roop.git
synced 2025-12-06 18:08:29 +00:00
Minor fixes
This commit is contained in:
parent
7cacbddb1f
commit
5625dc12d5
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user