From fd366d76b00366fc96516b16a2992992cb9359d7 Mon Sep 17 00:00:00 2001 From: Brainway Date: Tue, 14 Mar 2023 08:36:39 +0000 Subject: [PATCH] update ieemoo-ai-isempty.py. --- ieemoo-ai-isempty.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ieemoo-ai-isempty.py b/ieemoo-ai-isempty.py index a787196..936c4dc 100755 --- a/ieemoo-ai-isempty.py +++ b/ieemoo-ai-isempty.py @@ -80,8 +80,11 @@ class Predictor(object): probs = torch.nn.Softmax(dim=-1)(part_logits) topN = torch.argsort(probs, dim=-1, descending=True).tolist() clas_ids = topN[0][0] - clas_ids = 0 if 0==int(clas_ids) or 2 == int(clas_ids) or 3 == int(clas_ids) else 1 print("cur_img result: class id: %d, score: %0.3f" % (clas_ids, probs[0, clas_ids].item())) + if(int(clas_ids)==6 or int(clas_ids)==7): + clas_ids = 0 + else: + clas_ids = 1 result["success"] = "true" result["rst_cls"] = str(clas_ids) return result