优化文档检测的结果
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from onnxruntime import InferenceSession
|
||||
|
||||
PADDLE_DET = InferenceSession("model/object_det_model/ppyoloe_plus_crn_x_80e_coco_w_nms.onnx",
|
||||
PADDLE_DET = InferenceSession("model/object_det_model/ppyoloe_plus_crn_l_80e_coco_w_nms.onnx",
|
||||
providers=["CPUExecutionProvider"], provider_options=[{"device_id": 0}])
|
||||
|
||||
@@ -67,7 +67,10 @@ def request_book_areas(image):
|
||||
for img_str in img_str_list:
|
||||
img_data = base64.b64decode(img_str)
|
||||
np_array = np.frombuffer(img_data, np.uint8)
|
||||
result.append(cv2.imdecode(np_array, cv2.IMREAD_COLOR))
|
||||
img = cv2.imdecode(np_array, cv2.IMREAD_COLOR)
|
||||
height, width = img.shape[:2]
|
||||
if max(height, width) / min(height, width) <= 6.5:
|
||||
result.append(img) # 过滤异常结果
|
||||
return result
|
||||
else:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user