Remove py3.10 typing

pull/21/head
Kohaku-Blueleaf 2023-02-03 01:08:50 +08:00
parent 3aaf2d812c
commit 0b7ec7073d
9 changed files with 9 additions and 22 deletions

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from PIL import Image, ImageFilter, ImageColor
import numpy as np
import cv2

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from PIL import Image, ImageFilter

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from PIL import Image, ImageEnhance
import cv2
import numpy as np

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import Any
from typing import Any, Tuple, List, Union
from numpy.typing import NDArray
import cv2
@ -62,7 +62,7 @@ def run(
):
def curve(
img: NDArray,
*args: list[int]
*args: List[int]
):
nonlocal points
#all, r, g, b

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import Any
from typing import Any, Tuple, List, Union
from numpy.typing import NDArray
from itertools import product
@ -35,7 +35,7 @@ def dithering(
def run(
src,
k: int = 3,
) -> tuple[Image.Image, list[list[str|float]]]:
):
def calc():
pass
return Image.fromarray(result)

View File

@ -1,8 +1,3 @@
from __future__ import annotations
from typing import Any
from numpy.typing import NDArray
import cv2
from PIL import Image
import numpy as np

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import Any
from typing import Any, Tuple, List, Union
from numpy.typing import NDArray
import cv2
@ -92,7 +92,7 @@ def pixelize(
precise: int,
mode: str = 'dithering',
resize: bool = True
) -> tuple[NDArray[Any], NDArray[Any]]:
) -> Tuple[NDArray[Any], NDArray[Any]]:
'''
Use down scale and up scale to make pixel image.
@ -150,7 +150,7 @@ def run(
mode: str = 'kmeans',
precise: int = 10,
resize: bool = True
) -> tuple[Image.Image, list[list[str|float]]]:
) -> Tuple[Image.Image, List[List[Union[str, float]]]]:
#print('Start process.')
#print('Read raw image... ', end='', flush=True)
img = read_img_as_array(src)

View File

@ -1,11 +1,8 @@
from __future__ import annotations
from PIL import Image
import cv2
import numpy as np
def fix_float(val, eps=1e-3):
return float(val)-eps

View File

@ -1,4 +1,5 @@
from __future__ import annotations
from typing import Any, Tuple, List, Union
from modules import shared
from modules import scripts
@ -26,7 +27,7 @@ UI part
inpaint_base: gr.Image
inpaint_mask: gr.Image
all_btns: list[tuple[gr.Button, ...]] = []
all_btns: List[Tuple[gr.Button, ...]] = []
layers = int(shared.opts.data.get('hakuimg_layer_num', 5))
points = int(shared.opts.data.get('hakuimg_curve_points', 3))