mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-02-23 08:34:05 +00:00
fix: import annotations, misc
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import IntEnum
|
||||
from functools import partial, reduce
|
||||
from math import dist
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 = "",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
Reference in New Issue
Block a user