优化文档检测的结果
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
x-env:
|
x-env:
|
||||||
&template
|
&template
|
||||||
# 启动时可以指定环境变量TAG来手动选择镜像版本
|
# 可以在项目中创建.env文件,在其中定义TAG的值,使用以下命令在启动时替代默认的TAG
|
||||||
# docker-compose up -d -e TAG=1.0.0
|
# docker-compose --env-file .env up -d
|
||||||
image: fcb_photo_review:${TAG:-1.13.8}
|
image: fcb_photo_review:${TAG:-1.13.9}
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
services:
|
services:
|
||||||
@@ -132,6 +132,24 @@ services:
|
|||||||
capabilities: [ "gpu" ]
|
capabilities: [ "gpu" ]
|
||||||
driver: "nvidia"
|
driver: "nvidia"
|
||||||
|
|
||||||
|
photo_review_7:
|
||||||
|
<<: *template
|
||||||
|
container_name: photo_review_7
|
||||||
|
hostname: photo_review_7
|
||||||
|
volumes:
|
||||||
|
- ./log:/app/log
|
||||||
|
- ./model:/app/model
|
||||||
|
depends_on:
|
||||||
|
- photo_review_6
|
||||||
|
command: [ "photo_review.py" ]
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- device_ids: [ "0", "1" ]
|
||||||
|
capabilities: [ "gpu" ]
|
||||||
|
driver: "nvidia"
|
||||||
|
|
||||||
photo_mask_1:
|
photo_mask_1:
|
||||||
<<: *template
|
<<: *template
|
||||||
container_name: photo_mask_1
|
container_name: photo_mask_1
|
||||||
@@ -139,7 +157,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./log:/app/log
|
- ./log:/app/log
|
||||||
depends_on:
|
depends_on:
|
||||||
- photo_review_6
|
- photo_review_7
|
||||||
command: [ "photo_mask.py", "--clean", "True" ]
|
command: [ "photo_mask.py", "--clean", "True" ]
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from onnxruntime import InferenceSession
|
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}])
|
providers=["CPUExecutionProvider"], provider_options=[{"device_id": 0}])
|
||||||
|
|||||||
@@ -67,7 +67,10 @@ def request_book_areas(image):
|
|||||||
for img_str in img_str_list:
|
for img_str in img_str_list:
|
||||||
img_data = base64.b64decode(img_str)
|
img_data = base64.b64decode(img_str)
|
||||||
np_array = np.frombuffer(img_data, np.uint8)
|
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
|
return result
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in New Issue
Block a user