update ieemoo-ai-isempty.py.

This commit is contained in:
Brainway
2022-11-09 03:39:36 +00:00
committed by Gitee
parent 40154b9825
commit 3aee6d6c7a

View File

@ -139,27 +139,27 @@ def get_isempty():
img_data = Image.open('huanyuan.jpg')
result = predictor.normal_predict(img_data, result) # 1==empty, 0==nonEmpty
riseresult = lightrise.riseempty(img_data)
#riseresult = lightrise.riseempty(img_data)
#print(riseresult["rst_cls"])
if(result["rst_cls"]==1):
if(riseresult["rst_cls"]==1):
result = {}
result["success"] = "true"
result["rst_cls"] = 1
else:
result = {}
result["success"] = "true"
result["rst_cls"] = 0
else:
if(riseresult["rst_cls"]==0):
result = {}
result["success"] = "true"
result["rst_cls"] = 0
else:
result = {}
result["success"] = "true"
result["rst_cls"] = 1
# if(result["rst_cls"]==1):
# if(riseresult["rst_cls"]==1):
# result = {}
# result["success"] = "true"
# result["rst_cls"] = 1
# else:
# result = {}
# result["success"] = "true"
# result["rst_cls"] = 0
# else:
# if(riseresult["rst_cls"]==0):
# result = {}
# result["success"] = "true"
# result["rst_cls"] = 0
# else:
# result = {}
# result["success"] = "true"
# result["rst_cls"] = 1
return repr(result)