diff options
author | Leonard Kugis <leonard@kug.is> | 2023-03-22 04:34:02 +0100 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2023-03-22 04:34:02 +0100 |
commit | 9a1555f4dad58facef163ca486980143a0dd4c91 (patch) | |
tree | b270b8cc5431c9429872f0db8e0671b10e9125d5 /file-tagger.py | |
parent | a747254ece9da9af1517dd7dfdb4d16949b0eabb (diff) |
Added new options to GUI
Diffstat (limited to 'file-tagger.py')
-rw-r--r-- | file-tagger.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/file-tagger.py b/file-tagger.py index 92eb023..0cf1f76 100644 --- a/file-tagger.py +++ b/file-tagger.py @@ -77,7 +77,7 @@ def walk(args): tags_predict.update(predict_image(model, raw, args["predict_images_top"])) img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE) if not args["predict_images_skip_detail"]: - pool = ThreadPool(max(1, os.cpu_count() - 2), 1000) + pool = ThreadPool(max(1, os.cpu_count() - 2), 10000) for _ in range(4): if img.shape[0] > img.shape[1]: detail = image_resize(img.copy(), height=(args["predict_images_detail_factor"] * MODEL_DIMENSIONS)) @@ -85,7 +85,7 @@ def walk(args): detail = image_resize(img.copy(), width=(args["predict_images_detail_factor"] * MODEL_DIMENSIONS)) for x in range(0, detail.shape[0], int(MODEL_DIMENSIONS/2)): for y in range(0, detail.shape[1], int(MODEL_DIMENSIONS/2)): - pool.add_task(predict_partial, tags_predict, model, detail.copy(), x, y, args["predict_images_top"]) + pool.add_task(predict_partial, tags_predict, model, detail, x, y, args["predict_images_top"]) img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE) pool.wait_completion() tags_sorted = [tag[0] for tag in sorted(tags_predict, key=lambda tag: tag[1], reverse=True)] |