Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import os
|
3 |
import gradio as gr
|
4 |
from cerebras.cloud.sdk import Cerebras
|
@@ -216,7 +215,13 @@ def generate_video(
|
|
216 |
for line in linelevel_subs:
|
217 |
# ─ Static full‑line text
|
218 |
txt = TextClip(
|
219 |
-
line["word"]
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
x0 = (fw - txt.w) / 2
|
221 |
static = (
|
222 |
txt
|
@@ -230,7 +235,13 @@ def generate_video(
|
|
230 |
cursor = x0
|
231 |
for wd in line["textcontents"]:
|
232 |
wc = TextClip(
|
233 |
-
wd["word"]
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
hl = (
|
235 |
wc
|
236 |
.set_start(wd["start"])
|
@@ -240,7 +251,7 @@ def generate_video(
|
|
240 |
all_clips.append(hl)
|
241 |
|
242 |
# advance cursor by measuring a space after the word
|
243 |
-
dummy = TextClip(wd["word"] + " ")
|
244 |
cursor += dummy.w
|
245 |
|
246 |
# 8️⃣ Composite all clips and export
|
|
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from cerebras.cloud.sdk import Cerebras
|
|
|
215 |
for line in linelevel_subs:
|
216 |
# ─ Static full‑line text
|
217 |
txt = TextClip(
|
218 |
+
line["word"],
|
219 |
+
font=font,
|
220 |
+
fontsize=fs,
|
221 |
+
color="white",
|
222 |
+
stroke_color="black",
|
223 |
+
stroke_width=1
|
224 |
+
)
|
225 |
x0 = (fw - txt.w) / 2
|
226 |
static = (
|
227 |
txt
|
|
|
235 |
cursor = x0
|
236 |
for wd in line["textcontents"]:
|
237 |
wc = TextClip(
|
238 |
+
wd["word"],
|
239 |
+
font=font,
|
240 |
+
fontsize=fs,
|
241 |
+
color="yellow",
|
242 |
+
stroke_color="black",
|
243 |
+
stroke_width=1
|
244 |
+
)
|
245 |
hl = (
|
246 |
wc
|
247 |
.set_start(wd["start"])
|
|
|
251 |
all_clips.append(hl)
|
252 |
|
253 |
# advance cursor by measuring a space after the word
|
254 |
+
dummy = TextClip(wd["word"] + " ", font=font, fontsize=fs)
|
255 |
cursor += dummy.w
|
256 |
|
257 |
# 8️⃣ Composite all clips and export
|