fffiloni commited on
Commit
f0478d8
·
verified ·
1 Parent(s): a644739

make sure image input is squared 512

Browse files
Files changed (1) hide show
  1. webgui.py +3 -0
webgui.py CHANGED
@@ -160,6 +160,7 @@ def process_video(uploaded_img, uploaded_audio, width, height, length, seed, fac
160
 
161
  #### face musk prepare
162
  face_img = cv2.imread(uploaded_img)
 
163
  face_mask = np.zeros((face_img.shape[0], face_img.shape[1])).astype('uint8')
164
  det_bboxes, probs = face_detector.detect(face_img)
165
  select_bbox = select_face(det_bboxes, probs)
@@ -340,6 +341,8 @@ with gr.Blocks() as demo:
340
  if is_shared_ui:
341
  gr.Info("Trimming audio to max 10 seconds. Duplicate the space for unlimited audio length.")
342
  uploaded_audio = trim_audio(uploaded_audio, "trimmed_audio.wav")
 
 
343
 
344
  final_output_path = process_video(
345
  uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device
 
160
 
161
  #### face musk prepare
162
  face_img = cv2.imread(uploaded_img)
163
+ face_img = cv2.resize(face_img, (512, 512)) # make sure image is squared 512
164
  face_mask = np.zeros((face_img.shape[0], face_img.shape[1])).astype('uint8')
165
  det_bboxes, probs = face_detector.detect(face_img)
166
  select_bbox = select_face(det_bboxes, probs)
 
341
  if is_shared_ui:
342
  gr.Info("Trimming audio to max 10 seconds. Duplicate the space for unlimited audio length.")
343
  uploaded_audio = trim_audio(uploaded_audio, "trimmed_audio.wav")
344
+
345
+
346
 
347
  final_output_path = process_video(
348
  uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device