Skip to content

Commit

Permalink
Merge pull request #408 from DigitalSlideArchive/limit-ocr-concurrency
Browse files Browse the repository at this point in the history
The default thread pool concurrency is too much for ocr
  • Loading branch information
manthey authored May 23, 2024
2 parents 7404f19 + b7ce51b commit 73a1b13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Accept these; revisit as needed
CVE-2024-26597
CVE-2024-26865
CVE-2023-52433
CVE-2024-26642
CVE-2024-26643
CVE-2024-26800
CVE-2024-26828
CVE-2024-26585
CVE-2024-26865
CVE-2024-26921
CVE-2024-26923
CVE-2024-26924
CVE-2024-26925
CVE-2024-27397
2 changes: 1 addition & 1 deletion docs/INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Hardware Requirements

The recommended hardware is 32 GBytes of memory on a system with at least 4 cores. If you are using OCR, it is highly recommended to have an NVidia Cuda-capable GPU.

The minimum hardware is 4 GBytes of memory on a system with at least 2 cores (12 GBytes if using iSyntax files).
The minimum hardware is 4 GBytes of memory on a system with at least 2 cores, 8 GBytes is using OCR, and 12 GBytes if using iSyntax files.

The speed of your storage greatly affects the speed of the system. SSD drives will for import, local storage, and export are recommended.

Expand Down
4 changes: 3 additions & 1 deletion wsi_deid/jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import concurrent.futures
import os

from girder import logger
from girder.models.item import Item
Expand Down Expand Up @@ -227,7 +228,8 @@ def associate_unfiled_images(job): # noqa
# for itemId in itemIds:
# label_text = get_label_text_for_item(itemId, job)
label_text_list = []
with concurrent.futures.ThreadPoolExecutor() as executor:
with concurrent.futures.ThreadPoolExecutor(
max_workers=max(1, os.cpu_count() // 2)) as executor:
futures = []
for itemId in itemIds:
futures.append(executor.submit(get_label_text_for_item, itemId, job))
Expand Down

0 comments on commit 73a1b13

Please sign in to comment.