chore: remove custom cv2 type annotations (#8)

This commit is contained in:
2023-10-12 01:50:27 +08:00
parent 2895eb7233
commit 82229b8b5c
6 changed files with 32 additions and 84 deletions

View File

@ -1,17 +1,17 @@
import io
from collections.abc import Iterable
from typing import Callable, Tuple, TypeVar, Union, overload
from typing import Callable, TypeVar, Union, overload
import cv2
import numpy as np
from PIL import Image, ImageCms
from .types import Mat, XYWHRect
from .types import XYWHRect
__all__ = ["imread_unicode"]
def imread_unicode(filepath: str, flags: int = cv2.IMREAD_UNCHANGED) -> Mat:
def imread_unicode(filepath: str, flags: int = cv2.IMREAD_UNCHANGED):
# https://stackoverflow.com/a/57872297/16484891
# CC BY-SA 4.0
return cv2.imdecode(np.fromfile(filepath, dtype=np.uint8), flags)