From 9a1555f4dad58facef163ca486980143a0dd4c91 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Wed, 22 Mar 2023 04:34:02 +0100 Subject: Added new options to GUI --- file-tagger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'file-tagger.py') 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)] -- cgit v1.2.1