Spaces:
Running
on
L40S
Running
on
L40S
Update webgui.py
Browse files
webgui.py
CHANGED
@@ -170,9 +170,11 @@ def process_video(uploaded_img, uploaded_audio, width, height, length, seed, fac
|
|
170 |
# Calculate the new height with the same aspect ratio
|
171 |
new_height = int(original_height * (new_width / original_width))
|
172 |
|
173 |
-
#
|
174 |
-
|
|
|
175 |
|
|
|
176 |
# Resize the image to the calculated dimensions
|
177 |
face_image = cv2.resize(face_img, (new_width, new_height))
|
178 |
|
|
|
170 |
# Calculate the new height with the same aspect ratio
|
171 |
new_height = int(original_height * (new_width / original_width))
|
172 |
|
173 |
+
# Ensure both width and height are divisible by 8
|
174 |
+
new_width = (target_width // 8) * 8 # Force target width to be divisible by 8
|
175 |
+
new_height = (new_height // 8) * 8 # Floor the height to the nearest multiple of 8
|
176 |
|
177 |
+
|
178 |
# Resize the image to the calculated dimensions
|
179 |
face_image = cv2.resize(face_img, (new_width, new_height))
|
180 |
|