Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,8 @@ def infer_headswap(source, target):
|
|
63 |
full_frames, pad_top, pad_bottom, pad_left, pad_right, cv2.BORDER_CONSTANT, value=0)
|
64 |
dets = app.get(full_frames)
|
65 |
if len(dets) == 0:
|
66 |
-
|
|
|
67 |
kps = dets[0]['kps']
|
68 |
wide = wide_crop_face(full_frames, kps, return_M=target)
|
69 |
if target:
|
|
|
63 |
full_frames, pad_top, pad_bottom, pad_left, pad_right, cv2.BORDER_CONSTANT, value=0)
|
64 |
dets = app.get(full_frames)
|
65 |
if len(dets) == 0:
|
66 |
+
gr.Warning(f"no head on {'target' if target else 'source'} image")
|
67 |
+
raise gr.Error()
|
68 |
kps = dets[0]['kps']
|
69 |
wide = wide_crop_face(full_frames, kps, return_M=target)
|
70 |
if target:
|