fix: import annotations, misc

This commit is contained in:
Bingsu
2023-05-19 09:28:10 +09:00
parent eaf3ba414e
commit 2e07105c69
6 changed files with 10 additions and 5 deletions

View File

@@ -52,8 +52,8 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid):
ad_use_steps: bool = False
ad_steps: PositiveInt = 28
ad_use_cfg_scale: bool = False
ad_restore_face: bool = False
ad_cfg_scale: NonNegativeFloat = 7.0
ad_restore_face: bool = False
ad_controlnet_model: str = "None"
ad_controlnet_weight: confloat(ge=0.0, le=1.0) = 1.0

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from enum import IntEnum
from functools import partial, reduce
from math import dist

View File

@@ -1,4 +1,4 @@
from typing import Union
from __future__ import annotations
import numpy as np
from PIL import Image
@@ -8,7 +8,7 @@ from adetailer.common import create_mask_from_bbox
def mediapipe_predict(
model_type: Union[int, str], image: Image.Image, confidence: float = 0.3
model_type: int | str, image: Image.Image, confidence: float = 0.3
) -> PredictOutput:
import mediapipe as mp

View File

@@ -1,7 +1,6 @@
from __future__ import annotations
from pathlib import Path
from typing import Union
import cv2
from PIL import Image
@@ -11,7 +10,7 @@ from adetailer.common import create_mask_from_bbox
def ultralytics_predict(
model_path: Union[str, Path],
model_path: str | Path,
image: Image.Image,
confidence: float = 0.3,
device: str = "",

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING: