|
@@ -13,7 +13,7 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
|
|
import tensorflow as tf
|
|
import tensorflow as tf
|
|
from flask import Flask, request
|
|
from flask import Flask, request
|
|
from chinese_detect.inference_yolo_char import get_tiny_inference_model, detect
|
|
from chinese_detect.inference_yolo_char import get_tiny_inference_model, detect
|
|
-from utils import pil_resize, np2bytes, request_post, bytes2np, get_anchors, get_classes, get_colors
|
|
|
|
|
|
+from utils import pil_resize, np2bytes, request_post, bytes2np, get_anchors, get_classes, get_colors, base64_decode
|
|
|
|
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
tf.compat.v1.disable_eager_execution()
|
|
tf.compat.v1.disable_eager_execution()
|
|
@@ -50,7 +50,7 @@ def chd():
|
|
globals().update({"global_chd_model": chd_model})
|
|
globals().update({"global_chd_model": chd_model})
|
|
|
|
|
|
# 数据转换
|
|
# 数据转换
|
|
- data = base64.b64decode(data)
|
|
|
|
|
|
+ data = base64_decode(data)
|
|
image_np = bytes2np(data)
|
|
image_np = bytes2np(data)
|
|
# 预测
|
|
# 预测
|
|
_, out_boxes, out_classes = detect(image_np, chd_model, sess, is_tips=is_tips)
|
|
_, out_boxes, out_classes = detect(image_np, chd_model, sess, is_tips=is_tips)
|