-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
110 lines (98 loc) · 3.04 KB
/
pyproject.toml
File metadata and controls
110 lines (98 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
[project]
authors = [
{ name = "Tomoyuki Suzuki", email = "suzuki_tomoyuki@cyberagent.co.jp" },
]
name = "layerd"
version = "0.1.0"
description = "LayerD: Decomposing Raster Graphic Designs into Layers"
requires-python = ">=3.10.0"
dependencies = [
# Core dependencies for inference and evaluation
"numpy>=2.0",
"torch>=2.5.1",
"torchvision>=0.20.1",
"opencv-python-headless>=4.5.3",
"scikit-image>=0.25.0",
"tqdm>=4.62.0",
"huggingface-hub>=0.25.0",
"transformers>=4.37.2",
"einops>=0.8.0", # Required by BiRefNet model
"timm>=1.0.12", # Required by BiRefNet model
"kornia>=0.5.0", # Required by BiRefNet model
"pillow>=9.5.0",
"fsspec>=2021.10.0", # Filesystem abstraction for cloud storage support
"psd-tools>=1.9.0", # PSD export support
"pydantic>=2.5.2", # Pipeline result models for API compatibility
]
[project.scripts]
layerd = "layerd.cli:main"
[project.optional-dependencies]
# Dataset generation dependencies (tools/generate_crello_matting.py)
dataset = [
"datasets>=2.14.4", # HuggingFace datasets (Crello)
"skia-python>=120.0b5", # Rendering via cr-renderer
"pydantic>=2.5.2", # Schema validation for cr-renderer
]
# Training dependencies (tools/train.py)
train = [
"hydra-core>=1.3.2", # Config management
"accelerate>=0.28.0", # Optional distributed training
]
# OCR support with transformers backend (CUDA required)
# EAST backend works without extras (uses opencv from core)
ocr = [
"transformers>=4.37.2,<=4.48.0", # GOT-OCR2 requires transformers<=4.48.0 due to API changes in model.chat()
"verovio>=4.3.1", # Required by GOT-OCR2
]
# Convenience group for all optional dependencies
all = [
"datasets>=2.14.4",
"skia-python>=120.0b5",
"pydantic>=2.5.2",
"hydra-core>=1.3.2",
"accelerate>=0.28.0",
"transformers>=4.37.2,<=4.48.0",
"verovio>=4.3.1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/layerd"]
[tool.mypy]
ignore_missing_imports = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
no_implicit_optional = true
exclude = ["src/layerd/_vendor"]
[tool.ruff]
line-length = 120
target-version = "py310"
lint.ignore = ["F401", 'E741']
[tool.ruff.lint.isort]
known-first-party = ["layerd"]
[tool.uv]
index-strategy = "unsafe-best-match"
[tool.uv.pip]
emit-index-url = true
[dependency-groups]
dev = [
"ipykernel>=6.29.5",
"ipython>=8.29.0",
"matplotlib>=3.10.0",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"ruff>=0.8.0",
"mypy>=1.5.1",
"types-PyYAML>=6.0.0",
]
[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (loads ML models, runs inference, >30s on CPU)",
"integration: marks tests as integration tests (requires real models)",
"requires_gpu: marks tests that require GPU/CUDA",
]
filterwarnings = [
"ignore::FutureWarning:timm.models.layers",
"ignore::FutureWarning:timm.models.registry",
]