Spaces:
Running
Running
fuck js
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import os,
|
| 2 |
from functools import partial
|
| 3 |
import gradio as gr
|
| 4 |
|
|
@@ -34,14 +34,6 @@ css = """
|
|
| 34 |
#gr_chatbot {max-height: 480px;}
|
| 35 |
"""
|
| 36 |
|
| 37 |
-
get_gr_video_current_time = """async (video, _) => {
|
| 38 |
-
const videoEl = document.querySelector("#gr_video video");
|
| 39 |
-
if (!videoEl){
|
| 40 |
-
return [video, 0];
|
| 41 |
-
}
|
| 42 |
-
return [video, videoEl.currentTime];
|
| 43 |
-
}"""
|
| 44 |
-
|
| 45 |
with gr.Blocks(title="VideoLLM-online", css=css) as demo:
|
| 46 |
gr.Markdown("# VideoLLM-online: Online Video Large Language Model for Streaming Video", elem_id='gr_title')
|
| 47 |
with gr.Row():
|
|
@@ -97,10 +89,11 @@ with gr.Blocks(title="VideoLLM-online", css=css) as demo:
|
|
| 97 |
)
|
| 98 |
|
| 99 |
def gr_video_time_change(_, video_time):
|
| 100 |
-
|
|
|
|
| 101 |
liveinfer.input_video_stream(video_time)
|
| 102 |
return video_time
|
| 103 |
-
gr_video_time.change(gr_video_time_change, [gr_video, gr_video_time], [gr_video_time]
|
| 104 |
|
| 105 |
def gr_liveinfer_queue_refresher_change(history):
|
| 106 |
while True:
|
|
|
|
| 1 |
+
import os, torchvision, transformers, subprocess, huggingface_hub, time
|
| 2 |
from functools import partial
|
| 3 |
import gradio as gr
|
| 4 |
|
|
|
|
| 34 |
#gr_chatbot {max-height: 480px;}
|
| 35 |
"""
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
with gr.Blocks(title="VideoLLM-online", css=css) as demo:
|
| 38 |
gr.Markdown("# VideoLLM-online: Online Video Large Language Model for Streaming Video", elem_id='gr_title')
|
| 39 |
with gr.Row():
|
|
|
|
| 89 |
)
|
| 90 |
|
| 91 |
def gr_video_time_change(_, video_time):
|
| 92 |
+
time.sleep(1/30)
|
| 93 |
+
video_time += 1/30
|
| 94 |
liveinfer.input_video_stream(video_time)
|
| 95 |
return video_time
|
| 96 |
+
gr_video_time.change(gr_video_time_change, [gr_video, gr_video_time], [gr_video_time])
|
| 97 |
|
| 98 |
def gr_liveinfer_queue_refresher_change(history):
|
| 99 |
while True:
|