KingNish commited on
Commit
75b9121
1 Parent(s): 4e7357a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -25,7 +25,7 @@ def sample_frames(video_file) :
25
  try:
26
  video = cv2.VideoCapture(video_file)
27
  total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
28
- num_frames = 12
29
  interval = total_frames // num_frames
30
  frames = []
31
  for i in range(total_frames):
@@ -90,9 +90,8 @@ def respond(message, history):
90
  user_prompt = message
91
  # Handle image processing
92
  if message["files"]:
93
- image = user_prompt["files"][-1]
94
  txt = user_prompt["text"]
95
- img = user_prompt["files"]
96
 
97
  video_extensions = ("avi", "mp4", "mov", "mkv", "flv", "wmv", "mjpeg", "wav", "gif", "webm", "m4v", "3gp")
98
  image_extensions = Image.registered_extensions()
@@ -116,7 +115,6 @@ def respond(message, history):
116
 
117
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
118
  thread.start()
119
- gr.Info("Generating output")
120
 
121
  buffer = ""
122
  for new_text in streamer:
 
25
  try:
26
  video = cv2.VideoCapture(video_file)
27
  total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
28
+ num_frames = 6
29
  interval = total_frames // num_frames
30
  frames = []
31
  for i in range(total_frames):
 
90
  user_prompt = message
91
  # Handle image processing
92
  if message["files"]:
93
+ image = user_prompt["files"][0]
94
  txt = user_prompt["text"]
 
95
 
96
  video_extensions = ("avi", "mp4", "mov", "mkv", "flv", "wmv", "mjpeg", "wav", "gif", "webm", "m4v", "3gp")
97
  image_extensions = Image.registered_extensions()
 
115
 
116
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
117
  thread.start()
 
118
 
119
  buffer = ""
120
  for new_text in streamer: