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