root
commited on
Commit
·
fe51c8d
1
Parent(s):
3d59606
working but memory issues
Browse files- SimSwap +1 -0
- __pycache__/handler.cpython-310.pyc +0 -0
- handler.py +4 -4
- input.jpg +0 -0
- output.mp4 +0 -0
- output/gradio/animation_output.mp4 +0 -0
- output/gradio/cropped_face.jpg +0 -0
- roop/__pycache__/face_analyser.cpython-310.pyc +0 -0
- sampler.py +2 -2
- sped_up_pose_video.mp4 +0 -0
SimSwap
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit a5f6dea67398eec9ee71e156f7ad15dbd7ce4977
|
__pycache__/handler.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/handler.cpython-310.pyc and b/__pycache__/handler.cpython-310.pyc differ
|
|
|
handler.py
CHANGED
|
@@ -111,11 +111,11 @@ class EndpointHandler():
|
|
| 111 |
x, y, w, h = faces[0]
|
| 112 |
x_margin = int(margin * w)
|
| 113 |
y_margin = int(margin * h)
|
| 114 |
-
|
| 115 |
x1 = max(0, x - x_margin)
|
| 116 |
-
y1 = max(0, y - y_margin)
|
| 117 |
x2 = min(cv_image.shape[1], x + w + x_margin)
|
| 118 |
-
y2 = min(cv_image.shape[0], y + h + y_margin)
|
| 119 |
|
| 120 |
cropped_face = cv_image[y1:y2, x1:x2]
|
| 121 |
|
|
@@ -142,7 +142,7 @@ class EndpointHandler():
|
|
| 142 |
roop.globals.keep_frames = False
|
| 143 |
roop.globals.many_faces = False
|
| 144 |
roop.globals.video_encoder = "libx264"
|
| 145 |
-
roop.globals.video_quality =
|
| 146 |
roop.globals.max_memory = suggest_max_memory()
|
| 147 |
|
| 148 |
# Set GPU execution provider
|
|
|
|
| 111 |
x, y, w, h = faces[0]
|
| 112 |
x_margin = int(margin * w)
|
| 113 |
y_margin = int(margin * h)
|
| 114 |
+
|
| 115 |
x1 = max(0, x - x_margin)
|
| 116 |
+
y1 = max(0, y - y_margin // 2) # Less margin at the top
|
| 117 |
x2 = min(cv_image.shape[1], x + w + x_margin)
|
| 118 |
+
y2 = min(cv_image.shape[0], y + h + y_margin) # More margin at the bottom
|
| 119 |
|
| 120 |
cropped_face = cv_image[y1:y2, x1:x2]
|
| 121 |
|
|
|
|
| 142 |
roop.globals.keep_frames = False
|
| 143 |
roop.globals.many_faces = False
|
| 144 |
roop.globals.video_encoder = "libx264"
|
| 145 |
+
roop.globals.video_quality = 100
|
| 146 |
roop.globals.max_memory = suggest_max_memory()
|
| 147 |
|
| 148 |
# Set GPU execution provider
|
input.jpg
CHANGED
|
|
output.mp4
CHANGED
|
Binary files a/output.mp4 and b/output.mp4 differ
|
|
|
output/gradio/animation_output.mp4
ADDED
|
Binary file (103 kB). View file
|
|
|
output/gradio/cropped_face.jpg
CHANGED
|
|
roop/__pycache__/face_analyser.cpython-310.pyc
CHANGED
|
Binary files a/roop/__pycache__/face_analyser.cpython-310.pyc and b/roop/__pycache__/face_analyser.cpython-310.pyc differ
|
|
|
sampler.py
CHANGED
|
@@ -16,8 +16,8 @@ inputs = {
|
|
| 16 |
"inputs": {
|
| 17 |
"ref_image": ref_image_base64,
|
| 18 |
"pose_video_path": "pose_video.mp4",
|
| 19 |
-
"width":
|
| 20 |
-
"height":
|
| 21 |
"length": 24,
|
| 22 |
"num_inference_steps": 25,
|
| 23 |
"cfg": 3.5,
|
|
|
|
| 16 |
"inputs": {
|
| 17 |
"ref_image": ref_image_base64,
|
| 18 |
"pose_video_path": "pose_video.mp4",
|
| 19 |
+
"width": 378,
|
| 20 |
+
"height": 504,
|
| 21 |
"length": 24,
|
| 22 |
"num_inference_steps": 25,
|
| 23 |
"cfg": 3.5,
|
sped_up_pose_video.mp4
ADDED
|
Binary file (131 kB). View file
|
|
|