mirror of
https://github.com/s0md3v/roop.git
synced 2025-12-06 18:08:29 +00:00
issue #511
Avoiding of opencv unicode paths bug for process_image() method
This commit is contained in:
parent
e9b18a0528
commit
fd14cc4385
@ -79,10 +79,11 @@ def process_frames(source_path: str, temp_frame_paths: List[str], progress=None)
|
||||
|
||||
|
||||
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)
|
||||
source_face = get_one_face(cv2.imdecode(numpy.fromfile(source_path, dtype=numpy.uint8), cv2.IMREAD_UNCHANGED))
|
||||
target_frame = cv2.imdecode(numpy.fromfile(target_path, dtype=numpy.uint8), cv2.IMREAD_UNCHANGED)
|
||||
result = process_frame(source_face, target_frame)
|
||||
cv2.imwrite(output_path, result)
|
||||
is_success, im_buf_arr = cv2.imencode(".png", result)
|
||||
im_buf_arr.tofile(output_path)
|
||||
|
||||
|
||||
def process_video(source_path: str, temp_frame_paths: List[str]) -> None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user