From 00f680edd3ae40395e661f7f051dc4e4fddab133 Mon Sep 17 00:00:00 2001 From: 283375 Date: Mon, 23 Oct 2023 13:28:33 +0800 Subject: [PATCH] fix: `cv2.Mat` type annotation --- ui/extends/ocr/build_phash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/extends/ocr/build_phash.py b/ui/extends/ocr/build_phash.py index 81f8f6c..1f117eb 100644 --- a/ui/extends/ocr/build_phash.py +++ b/ui/extends/ocr/build_phash.py @@ -7,7 +7,7 @@ import numpy as np from arcaea_offline_ocr.phash_db import phash_opencv -def preprocess_char_icon(img_gray: cv2.Mat): +def preprocess_char_icon(img_gray: np.ndarray): h, w = img_gray.shape[:2] img = cv2.fillPoly( img_gray, @@ -23,7 +23,7 @@ def preprocess_char_icon(img_gray: cv2.Mat): def build_image_phash_database( - images: list[cv2.Mat], + images: list[np.ndarray], labels: list[str], *, hash_size: int = 16,