Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import os
|
|
4 |
import cv2
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
import glob
|
|
|
7 |
from datetime import datetime
|
8 |
|
9 |
is_shared_ui = True if "fffiloni/X-Portrait" in os.environ['SPACE_ID'] else False
|
@@ -138,8 +139,10 @@ div#frames-gallery{
|
|
138 |
overflow: scroll!important;
|
139 |
}
|
140 |
"""
|
|
|
141 |
example_frame_data = extract_frames_with_labels("./assets/driving_video.mp4")
|
142 |
with gr.Blocks(css=css) as demo:
|
|
|
143 |
with gr.Column(elem_id="col-container"):
|
144 |
gr.Markdown("# X-Portrait: Expressive Portrait Animation with Hierarchical Motion Attention")
|
145 |
gr.Markdown("On this shared UI, drinving video input will be trimmed to 2 seconds max. Duplicate this space for more controls.")
|
@@ -173,9 +176,9 @@ with gr.Blocks(css=css) as demo:
|
|
173 |
submit_btn = gr.Button("Submit")
|
174 |
gr.Examples(
|
175 |
examples=[
|
176 |
-
["./assets/source_image.png", "./assets/driving_video.mp4"
|
177 |
],
|
178 |
-
inputs=[source_image, driving_video
|
179 |
)
|
180 |
with gr.Column():
|
181 |
video_output = gr.Video(label="Output Video")
|
|
|
4 |
import cv2
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
import glob
|
7 |
+
from moviepy.editor import VideoFileClip
|
8 |
from datetime import datetime
|
9 |
|
10 |
is_shared_ui = True if "fffiloni/X-Portrait" in os.environ['SPACE_ID'] else False
|
|
|
139 |
overflow: scroll!important;
|
140 |
}
|
141 |
"""
|
142 |
+
|
143 |
example_frame_data = extract_frames_with_labels("./assets/driving_video.mp4")
|
144 |
with gr.Blocks(css=css) as demo:
|
145 |
+
|
146 |
with gr.Column(elem_id="col-container"):
|
147 |
gr.Markdown("# X-Portrait: Expressive Portrait Animation with Hierarchical Motion Attention")
|
148 |
gr.Markdown("On this shared UI, drinving video input will be trimmed to 2 seconds max. Duplicate this space for more controls.")
|
|
|
176 |
submit_btn = gr.Button("Submit")
|
177 |
gr.Examples(
|
178 |
examples=[
|
179 |
+
["./assets/source_image.png", "./assets/driving_video.mp4"]
|
180 |
],
|
181 |
+
inputs=[source_image, driving_video]
|
182 |
)
|
183 |
with gr.Column():
|
184 |
video_output = gr.Video(label="Output Video")
|