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