Spaces:
Running
on
Zero
Running
on
Zero
bugfix to display error
Browse files
app.py
CHANGED
@@ -102,7 +102,10 @@ def classify_video(video_path):
|
|
102 |
buf.seek(0)
|
103 |
plt.close(fig)
|
104 |
|
105 |
-
|
|
|
|
|
|
|
106 |
|
107 |
def process_video(video_file):
|
108 |
if video_file is None:
|
@@ -121,8 +124,8 @@ demo = gr.Interface(
|
|
121 |
title="Video Human Detection Demo using TimeSformer",
|
122 |
description=(
|
123 |
"Upload a video clip to see the top predicted human action labels using the TimeSformer model "
|
124 |
-
"(fine-tuned on Kinetics-400). The output shows each prediction
|
125 |
-
"
|
126 |
)
|
127 |
)
|
128 |
|
|
|
102 |
buf.seek(0)
|
103 |
plt.close(fig)
|
104 |
|
105 |
+
# Convert the BytesIO plot to a PIL Image.
|
106 |
+
chart_image = Image.open(buf)
|
107 |
+
|
108 |
+
return results_text, chart_image
|
109 |
|
110 |
def process_video(video_file):
|
111 |
if video_file is None:
|
|
|
124 |
title="Video Human Detection Demo using TimeSformer",
|
125 |
description=(
|
126 |
"Upload a video clip to see the top predicted human action labels using the TimeSformer model "
|
127 |
+
"(fine-tuned on Kinetics-400). The output shows each prediction (with class ID and label) and a bar chart "
|
128 |
+
"of the distribution over the top 5 predictions."
|
129 |
)
|
130 |
)
|
131 |
|