From cb77f229ab47e6e7261b1b77f200d219a752dd10 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Thu, 18 Jul 2024 16:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4model=E7=9A=84=E5=AD=98?= =?UTF-8?q?=E6=94=BE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- docker-compose-mask.yml | 51 +++++++++++++++++++++++ docker-compose-review.yml | 88 +++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 5 +++ photo_review/__init__.py | 8 ++-- 5 files changed, 148 insertions(+), 6 deletions(-) create mode 100644 docker-compose-mask.yml create mode 100644 docker-compose-review.yml diff --git a/.gitignore b/.gitignore index dec233c..3b9dfc1 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,4 @@ cython_debug/ .idea ### Model -config/model +model diff --git a/docker-compose-mask.yml b/docker-compose-mask.yml new file mode 100644 index 0000000..e0bd8e8 --- /dev/null +++ b/docker-compose-mask.yml @@ -0,0 +1,51 @@ +services: + photo_mask_1: + container_name: photo_mask_1 + image: fcb_photo_review + volumes: + - ./log:/app/log + restart: always + depends_on: + - photo_review_1 + command: [ "photo_mask.py", "--clean", "True" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_mask_2: + container_name: photo_mask_2 + image: fcb_photo_review + volumes: + - ./log:/app/log + restart: always + depends_on: + - photo_mask_1 + command: [ "photo_mask.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_mask_3: + container_name: photo_mask_3 + image: fcb_photo_review + volumes: + - ./log:/app/log + restart: always + depends_on: + - photo_mask_2 + command: [ "photo_mask.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" \ No newline at end of file diff --git a/docker-compose-review.yml b/docker-compose-review.yml new file mode 100644 index 0000000..f68d4f1 --- /dev/null +++ b/docker-compose-review.yml @@ -0,0 +1,88 @@ +services: + photo_review_1: + container_name: photo_review_1 + image: fcb_photo_review + volumes: + - ./log:/app/log + - ./model:/app/model + restart: always + command: [ "photo_review.py", "--clean", "True" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "0", "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_review_2: + container_name: photo_review_2 + image: fcb_photo_review + volumes: + - ./log:/app/log + - ./model:/app/model + restart: always + depends_on: + - photo_review_1 + command: [ "photo_review.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "0", "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_review_3: + container_name: photo_review_3 + image: fcb_photo_review + volumes: + - ./log:/app/log + - ./model:/app/model + restart: always + depends_on: + - photo_review_2 + command: [ "photo_review.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "0", "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_review_4: + container_name: photo_review_4 + image: fcb_photo_review + volumes: + - ./log:/app/log + - ./model:/app/model + restart: always + depends_on: + - photo_review_3 + command: [ "photo_review.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "0", "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" + + photo_review_5: + container_name: photo_review_5 + image: fcb_photo_review + volumes: + - ./log:/app/log + - ./model:/app/model + restart: always + depends_on: + - photo_review_4 + command: [ "photo_review.py" ] + deploy: + resources: + reservations: + devices: + - device_ids: [ "0", "1" ] + capabilities: [ "gpu" ] + driver: "nvidia" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4249960..2dd68f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: VERSION: "0.0.3" volumes: - ./log:/app/log + - ./model:/app/model restart: always command: [ "photo_review.py", "--clean", "True" ] deploy: @@ -23,6 +24,7 @@ services: image: fcb_photo_review volumes: - ./log:/app/log + - ./model:/app/model restart: always depends_on: - photo_review_1 @@ -40,6 +42,7 @@ services: image: fcb_photo_review volumes: - ./log:/app/log + - ./model:/app/model restart: always depends_on: - photo_review_2 @@ -57,6 +60,7 @@ services: image: fcb_photo_review volumes: - ./log:/app/log + - ./model:/app/model restart: always depends_on: - photo_review_3 @@ -74,6 +78,7 @@ services: image: fcb_photo_review volumes: - ./log:/app/log + - ./model:/app/model restart: always depends_on: - photo_review_4 diff --git a/photo_review/__init__.py b/photo_review/__init__.py index e9dba46..7b6e76f 100644 --- a/photo_review/__init__.py +++ b/photo_review/__init__.py @@ -60,12 +60,10 @@ COST_LIST_SCHEMA = PATIENT_NAME + ADMISSION_DATE + DISCHARGE_DATE + MEDICAL_EXPE 模型配置 """ SETTLEMENT_IE = Taskflow("information_extraction", schema=SETTLEMENT_LIST_SCHEMA, model="uie-x-base", - task_path="config/model/settlement_list_model", layout_analysis=LAYOUT_ANALYSIS, - precision='fp16') + task_path="model/settlement_list_model", layout_analysis=LAYOUT_ANALYSIS, precision='fp16') DISCHARGE_IE = Taskflow("information_extraction", schema=DISCHARGE_RECORD_SCHEMA, model="uie-x-base", - task_path="config/model/discharge_record_model", layout_analysis=LAYOUT_ANALYSIS, - precision='fp16') + task_path="model/discharge_record_model", layout_analysis=LAYOUT_ANALYSIS, precision='fp16') COST_IE = Taskflow("information_extraction", schema=COST_LIST_SCHEMA, model="uie-x-base", device_id=1, - task_path="config/model/cost_list_model", layout_analysis=LAYOUT_ANALYSIS, precision='fp16') + task_path="model/cost_list_model", layout_analysis=LAYOUT_ANALYSIS, precision='fp16') OCR = PaddleOCR(use_angle_cls=False, lang="ch", show_log=False, gpu_id=1)