Spaces:
Sleeping
Sleeping
Update webgui.py
Browse files
webgui.py
CHANGED
@@ -29,6 +29,7 @@ import gradio as gr
|
|
29 |
|
30 |
import huggingface_hub
|
31 |
from moviepy.editor import VideoFileClip, AudioFileClip, ImageClip
|
|
|
32 |
|
33 |
huggingface_hub.snapshot_download(
|
34 |
repo_id='BadToBest/EchoMimic',
|
@@ -157,6 +158,7 @@ def select_face(det_bboxes, probs):
|
|
157 |
return sorted_bboxes[0]
|
158 |
|
159 |
|
|
|
160 |
def process_video(uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device):
|
161 |
if seed is not None and seed > -1:
|
162 |
generator = torch.manual_seed(seed)
|
@@ -221,7 +223,7 @@ def process_video(uploaded_img, uploaded_audio, width, height, length, seed, fac
|
|
221 |
.margin(right=8, bottom=8, opacity=0) # ๋ง์ง ๋ฐ ํฌ๋ช
๋ ์ค์
|
222 |
.set_pos(("right", "bottom"))) # ์์น ์ค์
|
223 |
|
224 |
-
final_clip = video_clip.set_audio(audio_clip)
|
225 |
|
226 |
# APP.PY์ ๋์ผํ ๊ฒฝ๋ก์ ์์น์ํค๊ธฐ
|
227 |
final_output_path = Path(__file__).parent / "output_video_with_audio.mp4"
|
|
|
29 |
|
30 |
import huggingface_hub
|
31 |
from moviepy.editor import VideoFileClip, AudioFileClip, ImageClip
|
32 |
+
from moviepy.video.fx.all import composite
|
33 |
|
34 |
huggingface_hub.snapshot_download(
|
35 |
repo_id='BadToBest/EchoMimic',
|
|
|
158 |
return sorted_bboxes[0]
|
159 |
|
160 |
|
161 |
+
|
162 |
def process_video(uploaded_img, uploaded_audio, width, height, length, seed, facemask_dilation_ratio, facecrop_dilation_ratio, context_frames, context_overlap, cfg, steps, sample_rate, fps, device):
|
163 |
if seed is not None and seed > -1:
|
164 |
generator = torch.manual_seed(seed)
|
|
|
223 |
.margin(right=8, bottom=8, opacity=0) # ๋ง์ง ๋ฐ ํฌ๋ช
๋ ์ค์
|
224 |
.set_pos(("right", "bottom"))) # ์์น ์ค์
|
225 |
|
226 |
+
final_clip = composite(video_clip.set_audio(audio_clip), watermark)
|
227 |
|
228 |
# APP.PY์ ๋์ผํ ๊ฒฝ๋ก์ ์์น์ํค๊ธฐ
|
229 |
final_output_path = Path(__file__).parent / "output_video_with_audio.mp4"
|