Spaces:
Runtime error
Runtime error
Commit
·
8897375
1
Parent(s):
7e9295f
Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,13 @@ def edit_video(video_file, name, author, font, filter):
|
|
16 |
|
17 |
# Create an image with the author text
|
18 |
author_text = f"Author: {author}"
|
19 |
-
author_image = Image.new('RGB', (clip.w//2, clip.h//8), (0, 0, 0))
|
20 |
author_draw = ImageDraw.Draw(author_image)
|
21 |
author_draw.text((10, 10), author_text, font=font, fill=(255, 255, 255))
|
22 |
|
23 |
# Create an image with the bigger text
|
24 |
bigger_text = f"Author: {author}"
|
25 |
-
bigger_image = Image.new('RGB', (clip.w//2, clip.h//4), (0, 0, 0))
|
26 |
bigger_draw = ImageDraw.Draw(bigger_image)
|
27 |
bigger_draw.text((10, 10), bigger_text, font=font, fill=(255, 255, 255))
|
28 |
|
@@ -45,9 +45,9 @@ def video_editor(name, author, font, filter, video_file):
|
|
45 |
inputs = [
|
46 |
gr.Textbox(label="Video Name"),
|
47 |
gr.Textbox(label="Author Name"),
|
48 |
-
gr.Radio(["Arial", "
|
49 |
gr.Radio(["blur", "rotate", "resize", "mirror"], label="Filter"),
|
50 |
-
gr.inputs.File(label="Video File")
|
51 |
]
|
52 |
|
53 |
outputs = gr.outputs.File(label="Edited Video")
|
@@ -56,4 +56,4 @@ outputs = gr.outputs.File(label="Edited Video")
|
|
56 |
grapp = gr.Interface(fn=video_editor, inputs=inputs, outputs=outputs, capture_session=True)
|
57 |
|
58 |
# Run the Gradio app
|
59 |
-
grapp.launch()
|
|
|
16 |
|
17 |
# Create an image with the author text
|
18 |
author_text = f"Author: {author}"
|
19 |
+
author_image = Image.new('RGB', (clip.w // 2, clip.h // 8), (0, 0, 0))
|
20 |
author_draw = ImageDraw.Draw(author_image)
|
21 |
author_draw.text((10, 10), author_text, font=font, fill=(255, 255, 255))
|
22 |
|
23 |
# Create an image with the bigger text
|
24 |
bigger_text = f"Author: {author}"
|
25 |
+
bigger_image = Image.new('RGB', (clip.w // 2, clip.h // 4), (0, 0, 0))
|
26 |
bigger_draw = ImageDraw.Draw(bigger_image)
|
27 |
bigger_draw.text((10, 10), bigger_text, font=font, fill=(255, 255, 255))
|
28 |
|
|
|
45 |
inputs = [
|
46 |
gr.Textbox(label="Video Name"),
|
47 |
gr.Textbox(label="Author Name"),
|
48 |
+
gr.Radio(["Arial", "Barbie", "MrBeast", "OptiAgle"], label="Font"),
|
49 |
gr.Radio(["blur", "rotate", "resize", "mirror"], label="Filter"),
|
50 |
+
gr.inputs.File(label="Video File", type="file")
|
51 |
]
|
52 |
|
53 |
outputs = gr.outputs.File(label="Edited Video")
|
|
|
56 |
grapp = gr.Interface(fn=video_editor, inputs=inputs, outputs=outputs, capture_session=True)
|
57 |
|
58 |
# Run the Gradio app
|
59 |
+
grapp.launch()
|