Spaces:
Runtime error
Runtime error
Commit
·
5186ead
1
Parent(s):
2c5687c
Update app.py
Browse files
app.py
CHANGED
@@ -55,13 +55,17 @@ def model_interface(uploaded_video, activity):
|
|
55 |
concatenated_image = concatenate_frames(video, CLIP_LEN)
|
56 |
|
57 |
activities_list = [activity, "other"]
|
|
|
|
|
|
|
|
|
58 |
inputs = processor(
|
59 |
text=activities_list,
|
60 |
-
videos=
|
61 |
return_tensors="pt",
|
62 |
padding=True,
|
63 |
)
|
64 |
-
|
65 |
# Move inputs to GPU
|
66 |
inputs = {name: tensor.to(device) for name, tensor in inputs.items()}
|
67 |
|
|
|
55 |
concatenated_image = concatenate_frames(video, CLIP_LEN)
|
56 |
|
57 |
activities_list = [activity, "other"]
|
58 |
+
|
59 |
+
# Convert list of numpy.ndarrays to a single numpy.ndarray
|
60 |
+
video_array = np.array(video)
|
61 |
+
|
62 |
inputs = processor(
|
63 |
text=activities_list,
|
64 |
+
videos=video_array,
|
65 |
return_tensors="pt",
|
66 |
padding=True,
|
67 |
)
|
68 |
+
|
69 |
# Move inputs to GPU
|
70 |
inputs = {name: tensor.to(device) for name, tensor in inputs.items()}
|
71 |
|