From 6373df08b96c7b26d9e4604b64a5692cfa798c2f Mon Sep 17 00:00:00 2001 From: Brainway Date: Tue, 14 Mar 2023 08:39:12 +0000 Subject: [PATCH] update ieemoo-ai-isempty.py. --- ieemoo-ai-isempty.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ieemoo-ai-isempty.py b/ieemoo-ai-isempty.py index 936c4dc..18bb391 100755 --- a/ieemoo-ai-isempty.py +++ b/ieemoo-ai-isempty.py @@ -80,6 +80,7 @@ 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] + 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 @@ -87,6 +88,12 @@ class Predictor(object): clas_ids = 1 result["success"] = "true" result["rst_cls"] = str(clas_ids) + + # 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())) + # result["success"] = "true" + # result["rst_cls"] = str(clas_ids) + return result