Update app.py
Browse files
app.py
CHANGED
@@ -72,9 +72,12 @@ def process_and_generate_post(video_file, social_media_type):
|
|
72 |
# Retrieve Social media posts
|
73 |
social_media_post = t.select(t.answer).tail(1)['answer'][0]
|
74 |
|
|
|
|
|
|
|
75 |
# Retrieve thumbnails
|
76 |
thumbnails = frames_view.select(frames_view.frame).tail(2)['frame']
|
77 |
-
|
78 |
# Retrieve Pixeltable Table containing all videos and stored data
|
79 |
df_output = t.collect().to_pandas()
|
80 |
|
@@ -88,7 +91,7 @@ def process_and_generate_post(video_file, social_media_type):
|
|
88 |
import gradio as gr
|
89 |
|
90 |
def gradio_interface():
|
91 |
-
with gr.Blocks(theme=gr.themes.
|
92 |
gr.Markdown(
|
93 |
"""
|
94 |
<center>
|
@@ -115,6 +118,10 @@ def gradio_interface():
|
|
115 |
)
|
116 |
generate_btn = gr.Button("Generate Post")
|
117 |
|
|
|
|
|
|
|
|
|
118 |
with gr.Column():
|
119 |
output = gr.Textbox(label="Generated Social Media Post", show_copy_button=True)
|
120 |
thumbnail = gr.Gallery(
|
@@ -123,17 +130,14 @@ def gradio_interface():
|
|
123 |
show_fullscreen_button=True,
|
124 |
height='400px'
|
125 |
)
|
126 |
-
gr.
|
127 |
-
|
128 |
-
inputs=[video_input]
|
129 |
-
)
|
130 |
-
|
131 |
df_output = gr.DataFrame(label="Pixeltable Table")
|
132 |
|
133 |
generate_btn.click(
|
134 |
fn=process_and_generate_post,
|
135 |
inputs=[video_input, social_media_type],
|
136 |
-
outputs=[output, thumbnail, df_output],
|
137 |
)
|
138 |
|
139 |
return demo
|
|
|
72 |
# Retrieve Social media posts
|
73 |
social_media_post = t.select(t.answer).tail(1)['answer'][0]
|
74 |
|
75 |
+
# Retrieve Audio
|
76 |
+
audio = t.select(t.audio).tail(1)['audio'][0]
|
77 |
+
|
78 |
# Retrieve thumbnails
|
79 |
thumbnails = frames_view.select(frames_view.frame).tail(2)['frame']
|
80 |
+
|
81 |
# Retrieve Pixeltable Table containing all videos and stored data
|
82 |
df_output = t.collect().to_pandas()
|
83 |
|
|
|
91 |
import gradio as gr
|
92 |
|
93 |
def gradio_interface():
|
94 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
95 |
gr.Markdown(
|
96 |
"""
|
97 |
<center>
|
|
|
118 |
)
|
119 |
generate_btn = gr.Button("Generate Post")
|
120 |
|
121 |
+
gr.Examples(
|
122 |
+
examples=[["example1.mp4"], ["example2.mp4"], ["example3.mp4"]],
|
123 |
+
inputs=[video_input]
|
124 |
+
)
|
125 |
with gr.Column():
|
126 |
output = gr.Textbox(label="Generated Social Media Post", show_copy_button=True)
|
127 |
thumbnail = gr.Gallery(
|
|
|
130 |
show_fullscreen_button=True,
|
131 |
height='400px'
|
132 |
)
|
133 |
+
audio = gr.Audio()
|
134 |
+
|
|
|
|
|
|
|
135 |
df_output = gr.DataFrame(label="Pixeltable Table")
|
136 |
|
137 |
generate_btn.click(
|
138 |
fn=process_and_generate_post,
|
139 |
inputs=[video_input, social_media_type],
|
140 |
+
outputs=[output, thumbnail, df_output, audio],
|
141 |
)
|
142 |
|
143 |
return demo
|