-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,16 @@ | |
# Contact Info: [email protected] | ||
# Author/Copyright: Mr. Xiangyong Luo | ||
############################################################## | ||
|
||
|
||
from PIL import Image | ||
from __future__ import annotations | ||
from typing import TYPE_CHECKING | ||
import io | ||
|
||
# https://stackoverflow.com/questions/61384752/how-to-type-hint-with-an-optional-import | ||
if TYPE_CHECKING: | ||
# check the support version of python | ||
# https://pillow.readthedocs.io/en/stable/installation.html | ||
from PIL import Image | ||
|
||
|
||
def cvt_img_to_bytes(img_path: str) -> bytes: | ||
"""Convert image to bytes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,7 @@ Shapely>=2.0.3 | |
sphinx_multiproject>=1.0.0rc1 | ||
urllib3>=2.2.1 | ||
tqdm | ||
pyufunc | ||
pyufunc | ||
|
||
pillow | ||
opencv-python |