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