Merge pull request #28 from henryruhs/main
Skip processing if there is no face, print output to console
This commit is contained in:
commit
7041bad118
@ -14,11 +14,16 @@ def process_video(source_img, frame_paths):
|
|||||||
frame = cv2.imread(frame_path)
|
frame = cv2.imread(frame_path)
|
||||||
try:
|
try:
|
||||||
face = get_face(frame)
|
face = get_face(frame)
|
||||||
result = face_swapper.get(frame, face, source_face, paste_back=True)
|
if face:
|
||||||
cv2.imwrite(frame_path, result)
|
result = face_swapper.get(frame, face, source_face, paste_back=True)
|
||||||
|
cv2.imwrite(frame_path, result)
|
||||||
|
print('.', end='', flush=True)
|
||||||
|
else:
|
||||||
|
print('S', end='', flush=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print('E', end='', flush=True)
|
||||||
pass
|
pass
|
||||||
|
print(flush=True)
|
||||||
|
|
||||||
def process_img(source_img, target_path):
|
def process_img(source_img, target_path):
|
||||||
frame = cv2.imread(target_path)
|
frame = cv2.imread(target_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user