Spaces:
Runtime error
Runtime error
Amy Roberts
commited on
Commit
•
ac60993
1
Parent(s):
4707818
Tidy up
Browse files- app.py +12 -19
- gradio_cached_examples/12/log.csv +4 -0
- gradio_cached_examples/13/log.csv +4 -0
- gradio_cached_examples/14/log.csv +4 -0
app.py
CHANGED
@@ -127,38 +127,31 @@ EXAMPLES = [
|
|
127 |
["Intel/tvp-base", "a person reads a book.", "./examples/book.mp4", ],
|
128 |
]
|
129 |
|
130 |
-
model_checkpoint = gr.Dropdown(MODELS, label="Model", value=MODELS[0], type="value")
|
131 |
-
video_in = gr.Video(label="Video File", elem_id="video_in")
|
132 |
-
# text_in = gr.Textbox(label="Text", placeholder="Description of event in the video", interactive=True)
|
133 |
-
# text_out = gr.Textbox(label="Prediction", placeholder="Predicted start and end time")
|
134 |
-
# examples = gr.Examples(examples=EXAMPLES, fn=predict_durations, inputs=[model_checkpoint, text_in, video_in], outputs=[text_out], cache_examples=True, preprocess=False)
|
135 |
-
|
136 |
-
|
137 |
title = "Video Grounding with TVP"
|
138 |
DESCRIPTION = """# Video Grounding with TVP"""
|
139 |
-
|
140 |
with gr.Blocks(title=title) as demo:
|
141 |
gr.Markdown(DESCRIPTION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
with gr.Row():
|
143 |
model_checkpoint = gr.Dropdown(MODELS, label="Model", value=MODELS[0], type="value")
|
144 |
-
# model_checkpoint.render()
|
145 |
|
146 |
-
with gr.Row():
|
147 |
-
with gr.Column():
|
148 |
-
video_in.
|
149 |
|
150 |
with gr.Column():
|
151 |
text_in = gr.Textbox(label="Text", placeholder="Description of event in the video", interactive=True)
|
152 |
text_out = gr.Textbox(label="Prediction", placeholder="Predicted start and end time")
|
153 |
-
# text_in #.render()
|
154 |
time_button = gr.Button("Get start and end time")
|
155 |
time_button.click(predict_durations, inputs=[model_checkpoint, text_in, video_in], outputs=[text_out])
|
156 |
-
|
157 |
-
|
158 |
-
with gr.Row():
|
159 |
-
examples = gr.Examples(examples=EXAMPLES, fn=predict_durations, inputs=[model_checkpoint, text_in, video_in], outputs=[text_out], cache_examples=True, preprocess=False)
|
160 |
-
# examples.render()
|
161 |
-
# text_out.render()
|
162 |
|
163 |
|
164 |
if __name__ == "__main__":
|
|
|
127 |
["Intel/tvp-base", "a person reads a book.", "./examples/book.mp4", ],
|
128 |
]
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
title = "Video Grounding with TVP"
|
131 |
DESCRIPTION = """# Video Grounding with TVP"""
|
132 |
+
|
133 |
with gr.Blocks(title=title) as demo:
|
134 |
gr.Markdown(DESCRIPTION)
|
135 |
+
gr.Markdown(
|
136 |
+
"""
|
137 |
+
Video Grounding is the task of localizing a moment in a video that best matches a natural language description.
|
138 |
+
For example, given the video of a person sitting on a bed, the model should be able to predict the start and end time of the video that best matches the description "a person is sitting on a bed".
|
139 |
+
Enter a description of an event in the video and select a video to see the predicted start and end time.
|
140 |
+
"""
|
141 |
+
)
|
142 |
with gr.Row():
|
143 |
model_checkpoint = gr.Dropdown(MODELS, label="Model", value=MODELS[0], type="value")
|
|
|
144 |
|
145 |
+
with gr.Row(equal_height=True):
|
146 |
+
with gr.Column(scale=0.5):
|
147 |
+
video_in = gr.Video(label="Video File", elem_id="video_in")
|
148 |
|
149 |
with gr.Column():
|
150 |
text_in = gr.Textbox(label="Text", placeholder="Description of event in the video", interactive=True)
|
151 |
text_out = gr.Textbox(label="Prediction", placeholder="Predicted start and end time")
|
|
|
152 |
time_button = gr.Button("Get start and end time")
|
153 |
time_button.click(predict_durations, inputs=[model_checkpoint, text_in, video_in], outputs=[text_out])
|
154 |
+
examples = gr.Examples(examples=EXAMPLES, fn=predict_durations, inputs=[model_checkpoint, text_in, video_in], outputs=[text_out], cache_examples=True, preprocess=False)
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
|
157 |
if __name__ == "__main__":
|
gradio_cached_examples/12/log.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Prediction,flag,username,timestamp
|
2 |
+
"start: 0.0s, end: 6.8s",,,2023-11-22 16:36:10.654439
|
3 |
+
"start: 0.0s, end: 11.4s",,,2023-11-22 16:36:26.574274
|
4 |
+
"start: 0.0s, end: 5.6s",,,2023-11-22 16:36:42.339253
|
gradio_cached_examples/13/log.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Prediction,flag,username,timestamp
|
2 |
+
"start: 0.0s, end: 6.8s",,,2023-11-22 19:02:22.118880
|
3 |
+
"start: 0.0s, end: 11.4s",,,2023-11-22 19:02:38.302300
|
4 |
+
"start: 0.0s, end: 5.6s",,,2023-11-22 19:02:55.695928
|
gradio_cached_examples/14/log.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Prediction,flag,username,timestamp
|
2 |
+
"start: 0.0s, end: 6.8s",,,2023-11-22 16:26:11.313896
|
3 |
+
"start: 0.0s, end: 11.4s",,,2023-11-22 16:26:27.749260
|
4 |
+
"start: 0.0s, end: 5.6s",,,2023-11-22 16:26:43.506458
|