Spaces:
Paused
Paused
Update demo.py
Browse files
demo.py
CHANGED
@@ -239,8 +239,8 @@ class VideoCLSModel(VideoModel):
|
|
239 |
def predict(self, idx=0):
|
240 |
all_outputs, all_targets = self.forward(idx)
|
241 |
preds, targets = all_outputs.numpy(), all_targets.numpy()
|
242 |
-
|
243 |
-
sel = 5
|
244 |
df = pd.DataFrame(self.labels)
|
245 |
pred_action = df.iloc[preds[0].argsort()[-sel:]].values.tolist()
|
246 |
gt_action = df.iloc[np.where(targets[0])[0]].values.tolist()
|
|
|
239 |
def predict(self, idx=0):
|
240 |
all_outputs, all_targets = self.forward(idx)
|
241 |
preds, targets = all_outputs.numpy(), all_targets.numpy()
|
242 |
+
sel = np.where(np.cumsum(sorted(preds[0].tolist(), reverse=True)) > 0.055)[0][0]
|
243 |
+
#sel = 5
|
244 |
df = pd.DataFrame(self.labels)
|
245 |
pred_action = df.iloc[preds[0].argsort()[-sel:]].values.tolist()
|
246 |
gt_action = df.iloc[np.where(targets[0])[0]].values.tolist()
|