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