diff --git a/ieemoo-ai-isempty.py b/ieemoo-ai-isempty.py index 4c13ee9..65875ea 100755 --- a/ieemoo-ai-isempty.py +++ b/ieemoo-ai-isempty.py @@ -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__":