update ieemoo-ai-isempty.py.
This commit is contained in:
@ -124,16 +124,13 @@ def get_isempty():
|
|||||||
result = {"success": "false",
|
result = {"success": "false",
|
||||||
"rst_cls": '-1',
|
"rst_cls": '-1',
|
||||||
}
|
}
|
||||||
try:
|
|
||||||
imgdata = base64.b64decode(pic)
|
imgdata = base64.b64decode(pic)
|
||||||
imgdata_np = np.frombuffer(imgdata, dtype='uint8')
|
imgdata_np = np.frombuffer(imgdata, dtype='uint8')
|
||||||
img_src = cv2.imdecode(imgdata_np, cv2.IMREAD_COLOR)
|
img_src = cv2.imdecode(imgdata_np, cv2.IMREAD_COLOR)
|
||||||
img_data = Image.fromarray(np.uint8(img_src))
|
img_data = Image.fromarray(np.uint8(img_src))
|
||||||
result = predictor.normal_predict(img_data, result) # 1==empty, 0==nonEmpty
|
result = predictor.normal_predict(img_data, result) # 1==empty, 0==nonEmpty
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
return repr(result)
|
|
||||||
print(repr(result))
|
|
||||||
return repr(result)
|
return repr(result)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Reference in New Issue
Block a user