Spaces:
Runtime error
Runtime error
Commit
·
b495acb
1
Parent(s):
100a9ff
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def read_video_opencv(file_path, indices):
|
|
35 |
if success:
|
36 |
# Convert BGR to RGB
|
37 |
frames.append(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
|
38 |
-
return
|
39 |
|
40 |
|
41 |
def concatenate_frames(frames, clip_len):
|
@@ -71,6 +71,7 @@ def model_interface(uploaded_video, model_choice, activity):
|
|
71 |
activities_list = [activity, "other"]
|
72 |
processor = AutoProcessor.from_pretrained(model_choice)
|
73 |
model = AutoModel.from_pretrained(model_choice)
|
|
|
74 |
inputs = processor(
|
75 |
text=activities_list,
|
76 |
videos=list(video),
|
@@ -119,4 +120,13 @@ iface = gr.Interface(
|
|
119 |
live=False
|
120 |
)
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
iface.launch()
|
|
|
35 |
if success:
|
36 |
# Convert BGR to RGB
|
37 |
frames.append(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
|
38 |
+
return frames
|
39 |
|
40 |
|
41 |
def concatenate_frames(frames, clip_len):
|
|
|
71 |
activities_list = [activity, "other"]
|
72 |
processor = AutoProcessor.from_pretrained(model_choice)
|
73 |
model = AutoModel.from_pretrained(model_choice)
|
74 |
+
|
75 |
inputs = processor(
|
76 |
text=activities_list,
|
77 |
videos=list(video),
|
|
|
120 |
live=False
|
121 |
)
|
122 |
|
123 |
+
|
124 |
+
inputs = processor(
|
125 |
+
text=activities_list,
|
126 |
+
videos=np.array(video), # This line is changed.
|
127 |
+
return_tensors="pt",
|
128 |
+
padding=True,
|
129 |
+
)
|
130 |
+
|
131 |
+
|
132 |
iface.launch()
|