Spaces:
Building
Building
Update app.py
Browse files
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 =
|
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"][
|
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:
|