mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-07-01 12:26:27 +00:00
chore: partial numpy
& cv2
import to full import
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
from collections.abc import Iterable
|
||||
from typing import Callable, Tuple, TypeVar, Union, overload
|
||||
|
||||
from cv2 import IMREAD_UNCHANGED, imdecode
|
||||
from numpy import fromfile as np_fromfile
|
||||
from numpy import uint8
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from .types import Mat, XYWHRect
|
||||
|
||||
@ -13,7 +12,7 @@ __all__ = ["imread_unicode"]
|
||||
def imread_unicode(filepath: str) -> Mat:
|
||||
# https://stackoverflow.com/a/57872297/16484891
|
||||
# CC BY-SA 4.0
|
||||
return imdecode(np_fromfile(filepath, dtype=uint8), IMREAD_UNCHANGED)
|
||||
return cv2.imdecode(np.fromfile(filepath, dtype=np.uint8), cv2.IMREAD_UNCHANGED)
|
||||
|
||||
|
||||
def construct_int_xywh_rect(
|
||||
|
Reference in New Issue
Block a user