mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 19:29:54 +00:00
fix: dataclass to pydantic dataclass
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import OrderedDict
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from huggingface_hub import hf_hub_download
|
||||
from PIL import Image, ImageDraw
|
||||
from pydantic.dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class PredictOutput:
|
||||
bboxes: list[list[int]] | None = None
|
||||
masks: list[Image.Image] | None = None
|
||||
preview: Image.Image | None = None
|
||||
bboxes: Optional[list[list[int]]] = None
|
||||
masks: Optional[list[Image.Image]] = None
|
||||
preview: Optional[Image.Image] = None
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
||||
def get_models(model_dir: str | Path) -> OrderedDict[str, str | None]:
|
||||
|
||||
@@ -18,7 +18,7 @@ known_first_party = ["modules", "launch"]
|
||||
|
||||
[tool.ruff]
|
||||
select = ["A", "B", "C4", "E", "F", "I001", "ISC", "N", "PIE", "PT", "RET", "SIM", "UP", "W"]
|
||||
ignore = ["B008", "B905", "E501"]
|
||||
ignore = ["B008", "B905", "E501", "UP007"]
|
||||
unfixable = ["F401"]
|
||||
|
||||
[tool.ruff.isort]
|
||||
|
||||
Reference in New Issue
Block a user