Update app.py
Browse files
app.py
CHANGED
|
@@ -132,18 +132,18 @@ def infer(video_in):
|
|
| 132 |
print(extracted_audio)
|
| 133 |
|
| 134 |
# Get description of audio content
|
| 135 |
-
|
| 136 |
|
| 137 |
# Assemble captions
|
| 138 |
-
|
| 139 |
### Visual events:\n{string_list}\n ### Audio events:\n{audio_content_described}
|
| 140 |
"""
|
| 141 |
print(formatted_captions)
|
| 142 |
|
| 143 |
# Send formatted captions to LLM
|
| 144 |
#video_description_from_llm = llm_process(formatted_captions)
|
| 145 |
-
|
| 146 |
-
return
|
| 147 |
|
| 148 |
with gr.Blocks() as demo :
|
| 149 |
with gr.Column(elem_id="col-container"):
|
|
@@ -152,7 +152,7 @@ with gr.Blocks() as demo :
|
|
| 152 |
""")
|
| 153 |
video_in = gr.Video(label="Video input")
|
| 154 |
submit_btn = gr.Button("Submit")
|
| 155 |
-
video_description = gr.
|
| 156 |
submit_btn.click(
|
| 157 |
fn = infer,
|
| 158 |
inputs = [video_in],
|
|
|
|
| 132 |
print(extracted_audio)
|
| 133 |
|
| 134 |
# Get description of audio content
|
| 135 |
+
audio_content_described = get_salmonn(extracted_audio)
|
| 136 |
|
| 137 |
# Assemble captions
|
| 138 |
+
formatted_captions = f"""
|
| 139 |
### Visual events:\n{string_list}\n ### Audio events:\n{audio_content_described}
|
| 140 |
"""
|
| 141 |
print(formatted_captions)
|
| 142 |
|
| 143 |
# Send formatted captions to LLM
|
| 144 |
#video_description_from_llm = llm_process(formatted_captions)
|
| 145 |
+
|
| 146 |
+
return formatted_captions
|
| 147 |
|
| 148 |
with gr.Blocks() as demo :
|
| 149 |
with gr.Column(elem_id="col-container"):
|
|
|
|
| 152 |
""")
|
| 153 |
video_in = gr.Video(label="Video input")
|
| 154 |
submit_btn = gr.Button("Submit")
|
| 155 |
+
video_description = gr.Textbox(label="Video description")
|
| 156 |
submit_btn.click(
|
| 157 |
fn = infer,
|
| 158 |
inputs = [video_in],
|