LanguageBind commited on
Commit
acd4f5a
1 Parent(s): 2296892

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +67 -3
app.py CHANGED
@@ -113,7 +113,7 @@ def generate(image1, video, textbox_in, first_run, state, state_, images_tensor)
113
  if flag:
114
  state.append_message(state.roles[0], textbox_in + "\n" + show_images)
115
  state.append_message(state.roles[1], textbox_out)
116
-
117
  return (state, state_, state.to_gradio_chatbot(), False, gr.update(value=None, interactive=True), images_tensor, gr.update(value=image1 if os.path.exists(image1) else None, interactive=True), gr.update(value=video if os.path.exists(video) else None, interactive=True))
118
 
119
  def regenerate(state, state_):
@@ -232,18 +232,82 @@ with gr.Blocks(title='Video-LLaVA🚀', theme=gr.themes.Default(), css=block_css
232
  f"{cur_dir}/examples/sample_demo_1.mp4",
233
  "Why is this video funny?",
234
  ],
 
 
 
 
235
  [
236
  f"{cur_dir}/examples/sample_demo_3.mp4",
237
- "Can you identify any safety hazards in this video?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  ],
239
  [
240
- f"{cur_dir}/examples/sample_demo_9.mp4",
241
  "Describe the video.",
242
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  [
244
  f"{cur_dir}/examples/sample_demo_22.mp4",
245
  "Describe the activity in the video.",
246
  ],
 
 
 
 
247
  ],
248
  inputs=[video, textbox],
249
  )
 
113
  if flag:
114
  state.append_message(state.roles[0], textbox_in + "\n" + show_images)
115
  state.append_message(state.roles[1], textbox_out)
116
+ torch.cuda.empty_cache()
117
  return (state, state_, state.to_gradio_chatbot(), False, gr.update(value=None, interactive=True), images_tensor, gr.update(value=image1 if os.path.exists(image1) else None, interactive=True), gr.update(value=video if os.path.exists(video) else None, interactive=True))
118
 
119
  def regenerate(state, state_):
 
232
  f"{cur_dir}/examples/sample_demo_1.mp4",
233
  "Why is this video funny?",
234
  ],
235
+ [
236
+ f"{cur_dir}/examples/sample_demo_2.mp4",
237
+ "what is strange about this video?",
238
+ ],
239
  [
240
  f"{cur_dir}/examples/sample_demo_3.mp4",
241
+ "Can you identify any safety hazards in this video?",
242
+ ],
243
+ [
244
+ f"{cur_dir}/examples/sample_demo_4.mp4",
245
+ "what is unusual about this video?",
246
+ ],
247
+ [
248
+ f"{cur_dir}/examples/sample_demo_6.mp4",
249
+ "Can you write a short poem inspired fom the video.",
250
+ ],
251
+ [
252
+ f"{cur_dir}/examples/sample_demo_7.mp4",
253
+ "Create a short fairy tale with a moral lesson inspired by the video.",
254
+ ],
255
+ [
256
+ f"{cur_dir}/examples/sample_demo_8.mp4",
257
+ "Where is this video taken from? What place/landmark is shown in the video?",
258
+ ],
259
+ [
260
+ f"{cur_dir}/examples/sample_demo_10.mp4",
261
+ "Describe the video in detail.",
262
+ ],
263
+ [
264
+ f"{cur_dir}/examples/sample_demo_11.mp4",
265
+ "What is the main focus of the video.",
266
+ ],
267
+ [
268
+ f"{cur_dir}/examples/sample_demo_12.mp4",
269
+ "What does the woman use to split the logs and how does she do it?",
270
  ],
271
  [
272
+ f"{cur_dir}/examples/sample_demo_13.mp4",
273
  "Describe the video.",
274
  ],
275
+ [
276
+ f"{cur_dir}/examples/sample_demo_14.mp4",
277
+ "What is the video about?",
278
+ ],
279
+ [
280
+ f"{cur_dir}/examples/sample_demo_15.mp4",
281
+ "What is the main challenge faced by the people on the boat?",
282
+ ],
283
+ [
284
+ f"{cur_dir}/examples/sample_demo_17.mp4",
285
+ "What activities are the woman and the dog engaged in the video?",
286
+ ],
287
+ [
288
+ f"{cur_dir}/examples/sample_demo_18.mp4",
289
+ "Describe the video in detail.",
290
+ ],
291
+ [
292
+ f"{cur_dir}/examples/sample_demo_19.mp4",
293
+ "What is the video about?",
294
+ ],
295
+ [
296
+ f"{cur_dir}/examples/sample_demo_20.mp4",
297
+ "Can you describe the process for cleaning a screen window as demonstrated in the video?",
298
+ ],
299
+ [
300
+ f"{cur_dir}/examples/sample_demo_21.mp4",
301
+ "Step-by-step describe the cooking recipe shown in the video.",
302
+ ],
303
  [
304
  f"{cur_dir}/examples/sample_demo_22.mp4",
305
  "Describe the activity in the video.",
306
  ],
307
+ [
308
+ f"{cur_dir}/examples/sample_demo_23.mp4",
309
+ "Briefly describe the video.",
310
+ ],
311
  ],
312
  inputs=[video, textbox],
313
  )