增加检测矫正后用时上升比较明显,常规启用photo_review_6来弥补
This commit is contained in:
10
det_test.py
10
det_test.py
@@ -1,10 +0,0 @@
|
||||
import time
|
||||
|
||||
from paddle_detection import detector
|
||||
from util import image_util
|
||||
|
||||
if __name__ == '__main__':
|
||||
image = image_util.read("paddle_detection/docs/images/000000014439.jpg")
|
||||
start = time.time()
|
||||
images = detector.get_book_areas(image)
|
||||
print(f"耗时:{time.time() - start}")
|
||||
@@ -1,6 +1,6 @@
|
||||
x-env:
|
||||
&template
|
||||
image: fcb_photo_review:1.13.6
|
||||
image: fcb_photo_review:1.13.7
|
||||
restart: always
|
||||
|
||||
services:
|
||||
@@ -94,23 +94,23 @@ services:
|
||||
capabilities: [ "gpu" ]
|
||||
driver: "nvidia"
|
||||
|
||||
# photo_review_6:
|
||||
# <<: *template
|
||||
# container_name: photo_review_6
|
||||
# hostname: photo_review_6
|
||||
# volumes:
|
||||
# - ./log:/app/log
|
||||
# - ./model:/app/model
|
||||
# depends_on:
|
||||
# - photo_review_5
|
||||
# command: [ "photo_review.py" ]
|
||||
# deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
# devices:
|
||||
# - device_ids: [ "0", "1" ]
|
||||
# capabilities: [ "gpu" ]
|
||||
# driver: "nvidia"
|
||||
photo_review_6:
|
||||
<<: *template
|
||||
container_name: photo_review_6
|
||||
hostname: photo_review_6
|
||||
volumes:
|
||||
- ./log:/app/log
|
||||
- ./model:/app/model
|
||||
depends_on:
|
||||
- photo_review_5
|
||||
command: [ "photo_review.py" ]
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- device_ids: [ "0", "1" ]
|
||||
capabilities: [ "gpu" ]
|
||||
driver: "nvidia"
|
||||
|
||||
photo_mask_1:
|
||||
<<: *template
|
||||
@@ -119,7 +119,7 @@ services:
|
||||
volumes:
|
||||
- ./log:/app/log
|
||||
depends_on:
|
||||
- photo_review_5
|
||||
- photo_review_6
|
||||
command: [ "photo_mask.py", "--clean", "True" ]
|
||||
deploy:
|
||||
resources:
|
||||
|
||||
@@ -82,16 +82,12 @@ def information_extraction(ie, phrecs, identity):
|
||||
|
||||
image = image_util.read(img_path)
|
||||
target_images = []
|
||||
det_time = time.time()
|
||||
target_images += detector.get_book_areas(image) # 识别文档区域并裁剪
|
||||
logging.info(f"det耗时:{time.time() - det_time}")
|
||||
if not target_images:
|
||||
target_images.append(image) # 识别失败
|
||||
angle_count = defaultdict(int, {"0": 0}) # 分割后图片的最优角度统计
|
||||
for target_image in target_images:
|
||||
dewarp_time = time.time()
|
||||
dewarped_image = dewarp.dewarp_image(target_image) # 去扭曲
|
||||
logging.info(f"dewarp耗时:{time.time() - dewarp_time}")
|
||||
angles = image_util.parse_rotation_angles(dewarped_image)
|
||||
zx_ie_results = []
|
||||
split_results = image_util.split(dewarped_image)
|
||||
|
||||
Reference in New Issue
Block a user