4 Commits

2 changed files with 35 additions and 4 deletions

10
a.py Normal file
View File

@ -0,0 +1,10 @@
from PIL import Image
from wdtagger import Tagger
if __name__ == "__main__":
tagger = Tagger()
images = [
Image.open("./tests/images/赤松楓.9d64b955.jpeg"),
]
results = tagger.tag(images)

View File

@ -1,6 +1,6 @@
[project]
name = "wdtagger"
version = "0.11.2"
version = "0.13.0"
description = "A simple and easy-to-use wrapper for the tagger model created by [SmilingWolf](https://github.com/SmilingWolf) which is specifically designed for tagging anime illustrations."
authors = [{ name = "Jianqi Pan", email = "jannchie@gmail.com" }]
readme = "README.md"
@ -17,8 +17,8 @@ dev = ["pytest>=8.3.3", "pytest-benchmark>=5.1.0", "ruff>=0.8.0"]
[project.optional-dependencies]
cpu = ["torch>=2.5.1", "torchvision>=0.20.1", "timm>=1.0.11"]
gpu = ["torch>=2.5.1", "torchvision>=0.20.1", "timm>=1.0.11"]
cpu = ["torch>=2.0.0", "torchvision>=0.20.1", "timm>=1.0.11"]
gpu = ["torch>=2.0.0", "torchvision>=0.20.1", "timm>=1.0.11"]
[tool.ruff]
line-length = 140
@ -39,18 +39,29 @@ ignore = [
[tool.pyright]
[tool.uv]
conflicts = [[{ extra = "cpu" }, { extra = "gpu" }]]
conflicts = [
[
{ extra = "cpu" },
{ extra = "gpu" },
{ extra = "cuda11" },
{ extra = "cuda12" },
],
]
package = true
[tool.uv.sources]
torch = [
{ index = "torch-cpu", extra = "cpu" },
{ index = "torch-gpu", extra = "gpu" },
{ index = "torch-cuda11", extra = "cuda11" },
{ index = "torch-cuda12", extra = "cuda12" },
]
torchvision = [
{ index = "torch-cpu", extra = "cpu" },
{ index = "torch-gpu", extra = "gpu" },
{ index = "torch-cuda11", extra = "cuda11" },
{ index = "torch-cuda12", extra = "cuda12" },
]
[[tool.uv.index]]
@ -63,6 +74,16 @@ name = "torch-gpu"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[[tool.uv.index]]
name = "torch-cuda11"
url = "https://download.pytorch.org/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cuda12"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"