Browse Source
add omnivore
Signed-off-by: gexy5 <xinyu.ge@zilliz.com>
main
gexy5
3 years ago
1 changed files with
1 additions and
1 deletions
-
omnivore.py
|
@ -101,7 +101,7 @@ class Omnivore(NNOperator): |
|
|
|
|
|
|
|
|
outs = self.model(inputs) |
|
|
outs = self.model(inputs) |
|
|
post_act = torch.nn.Softmax(dim=1) |
|
|
post_act = torch.nn.Softmax(dim=1) |
|
|
preds = post_act(outs) |
|
|
|
|
|
|
|
|
preds = post_act(outs,input_type="video") |
|
|
pred_scores, pred_classes = preds.topk(k=self.topk) |
|
|
pred_scores, pred_classes = preds.topk(k=self.topk) |
|
|
labels = [self.classmap[int(i)] for i in pred_classes[0]] |
|
|
labels = [self.classmap[int(i)] for i in pred_classes[0]] |
|
|
scores = [round(float(x), 5) for x in pred_scores[0]] |
|
|
scores = [round(float(x), 5) for x in pred_scores[0]] |
|
|