ai-forever commited on
Commit
1bc8161
·
verified ·
1 Parent(s): 591e218

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- raise gr.Error(f"no head on {'target' if target else 'source'} image", duration=-1)
 
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: