-
Notifications
You must be signed in to change notification settings - Fork 852
Expand file tree
/
Copy pathpyproject.toml
More file actions
296 lines (277 loc) · 8.33 KB
/
pyproject.toml
File metadata and controls
296 lines (277 loc) · 8.33 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "rfdetr"
version = "1.7.0.rc0"
description = "RF-DETR"
readme = "README.md"
authors = [
{name = "Roboflow, Inc", email = "develop@roboflow.com"}
]
license = {text = "Apache License 2.0"}
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS"
]
keywords = ["machine-learning", "deep-learning", "vision", "ML", "DL", "AI", "DETR", "RF-DETR", "Roboflow"]
dependencies = [
"requests", # weight download from remote URLs
"torch>=2.2.0", # core tensor ops and model forward pass
"torchvision>=0.17.0", # image transforms and ops (aligned with torch>=2.2.0)
"tqdm", # progress bars during weight download
"transformers>=5.1.0,<6.0.0", # DINOv2 backbone loading
"pydantic>=2.0,<3", # ModelConfig / TrainConfig validation
"supervision", # inference output (Detections, Masks)
"pyDeprecate>=0.6,<0.8", # deprecation warnings for legacy APIs; >=0.6 for deprecated_class
]
[project.optional-dependencies]
lora = [
"peft", # LoRA backbone fine-tuning
]
train = [
"peft", # LoRA backbone fine-tuning (available during training)
"pytorch_lightning>=2.6,<3",
"torchmetrics[detection]>=1.2",
"faster-coco-eval>=1.7.2",
"pycocotools",
"scipy",
"albumentations>=1.4.24,<3.0.0",
"roboflow",
"rf100vl",
]
onnx = [
"onnx>=1.16.0,<1.20",
"onnxsim<0.6.0", # TODO: onnxsim 0.6.0+ hangs on install
"onnx_graphsurgeon",
"onnxruntime",
"polygraphy",
]
trt = [
"pycuda",
"onnxruntime-gpu",
"tensorrt>=8.6.1",
"polygraphy",
]
tflite = [
"onnx2tf>=1.26.0,<2.0.0",
"flatbuffers>=23.5.26",
"onnx>=1.16.0,<1.20",
"tf-keras>=2.16.0",
"tensorflow>=2.16.0",
]
kornia = [
"kornia>=0.7,<1", # GPU-side augmentation via on_after_batch_transfer
]
loggers = [
"tensorboard>=2.13.0",
"protobuf>=3.20.0,<4.0.0", # Pins protobuf below 4.x to avoid TensorBoard descriptor crash with protobuf>=4 (see #844)
"wandb",
"mlflow",
"clearml",
]
visual = [
"matplotlib",
"pandas",
"seaborn",
]
cli = ["jsonargparse[signatures]>=4.27.7"]
plus = ["rfdetr_plus>=1.0.1, <2.0.0"]
[dependency-groups]
# TODO: Temporary: GPU runner only has CUDA 12.8 driver (12080); torch>=2.11 requires a newer driver.
# Remove this group and the --group ci-gpu-pin references in CI once the driver is updated.
# Does not affect users installing rfdetr from PyPI.
ci-gpu-pin = [
"torch<2.11",
]
build = [
"twine>=5.1.1",
"wheel>=0.40",
"build>=0.10"
]
tests = [
"pytest>=7.2,<9",
"pytest-cov>=4,<8",
"pytest-xdist>=3.6,<4",
"pytest-rerunfailures>=10,<15",
"pytest-timeout>=2,<3",
"pytest-doctestplus>=1.2,<2",
"tomli>=2.0; python_version < '3.11'",
]
typing = [
"mypy>=1.0",
# mypy 1.19.x can crash while processing NumPy 2.4 symbols in strict mode.
"numpy<2.4",
"types-PyYAML",
"types-requests",
"types-tqdm",
]
docs = [
"mkdocs-material[imaging]>=9.7",
"mkdocstrings>=0.25.2,<0.30.0",
"mkdocstrings-python>=1.10.9",
"mike>=2.0.0",
"mkdocs-jupyter>=0.24.3",
"mkdocs-git-committers-plugin-2>=2.4.1",
"mkdocs-git-revision-date-localized-plugin>=1.2.4",
"tomli>=2.0; python_version < '3.11'",
]
[project.urls]
Homepage = "https://github.com/roboflow/rf-detr"
[project.scripts]
rfdetr = "rfdetr.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
include = ["rfdetr*"]
[tool.setuptools]
include-package-data = false
[tool.setuptools.package-data]
rfdetr = ["py.typed", "models/backbone/dinov2_configs/*.json"]
[tool.ruff]
fix = true
line-length = 120
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming: lowercase variables (N806) and arguments (N803)
]
extend-select = [
"RUF100", # yesqa
]
ignore = [
"E722", # todo: Do not use bare `except`
]
[tool.ruff.lint.per-file-ignores]
"notebooks/*.py" = ["E402"] # cell-local imports are intentional in percent-format scripts
[tool.pytest.ini_options]
addopts = [
"-v", # verbose output
"--color=yes", # colored output
"--doctest-plus", # run doctests from all modules (pytest-doctestplus)
]
pythonpath = ["src"]
markers = [
"gpu: tests that require GPU or are slow on CPU",
"flaky: tests that may fail due to nondeterminism",
"tflite: tests requiring onnx2tf and TFLite dependencies",
]
filterwarnings = [
# pytest-xdist workers close their channel before teardown completes;
# this is a known false-positive that does not affect test results.
"ignore::pluggy.PluggyTeardownRaisedWarning",
]
[tool.codespell]
skip = "*.pth"
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = false
explicit_package_bases = true
strict = true
mypy_path = "src"
exclude = [
"^docs/(hooks|scripts)/",
]
overrides = [
{ module = [
"tests.*",
"einops", "einops.*",
"matplotlib", "matplotlib.*",
"pandas", "pandas.*",
"seaborn", "seaborn.*",
], ignore_errors = true },
{ module = [
"torchvision", "torchvision.*",
"pycocotools", "pycocotools.*",
"timm", "timm.*",
"einops", "einops.*",
"deprecate", "deprecate.*",
"matplotlib", "matplotlib.*",
"pandas", "pandas.*",
"requests", "requests.*",
"seaborn", "seaborn.*",
"tqdm", "tqdm.*",
"kornia", "kornia.*",
"onnx", "onnx.*",
"onnx2tf", "onnx2tf.*",
"tflite_runtime", "tflite_runtime.*",
"tensorflow", "tensorflow.*",
], ignore_missing_imports = true },
# Modules with pre-existing type errors — ignored until incrementally fixed.
{ module = [
"rfdetr",
"rfdetr._namespace",
"rfdetr.assets.model_weights",
"rfdetr.config",
"rfdetr.datasets._develop",
"rfdetr.datasets.coco",
"rfdetr.datasets.save_grids",
"rfdetr.datasets.synthetic",
"rfdetr.datasets.transforms",
"rfdetr.datasets.yolo",
"rfdetr.detr",
"rfdetr.evaluation.coco_eval",
"rfdetr.evaluation.matching",
"rfdetr.export._onnx.exporter",
"rfdetr.export._onnx.symbolic",
"rfdetr.export.benchmark",
"rfdetr.export.main",
"rfdetr.export.tensorrt",
"rfdetr.models.backbone",
"rfdetr.models.backbone.backbone",
"rfdetr.models.backbone.base",
"rfdetr.models.backbone.dinov2",
"rfdetr.models.backbone.dinov2_with_windowed_attn",
"rfdetr.models.backbone.projector",
"rfdetr.models.criterion",
"rfdetr.models.heads.detection",
"rfdetr.models.heads.segmentation",
"rfdetr.models.lwdetr",
"rfdetr.models.math",
"rfdetr.models.matcher",
"rfdetr.models.ops.functions.ms_deform_attn_func",
"rfdetr.models.ops.modules.ms_deform_attn",
"rfdetr.models.position_encoding",
"rfdetr.models.postprocess",
"rfdetr.models.transformer",
"rfdetr.models.weights",
"rfdetr.platform",
"rfdetr.platform.downloads",
"rfdetr.platform.models",
"rfdetr.training.callbacks.best_model",
"rfdetr.training.callbacks.coco_eval",
"rfdetr.training.callbacks.drop_schedule",
"rfdetr.training.callbacks.ema",
"rfdetr.training.cli",
"rfdetr.training.drop_schedule",
"rfdetr.training.model_ema",
"rfdetr.training.module_data",
"rfdetr.training.module_model",
"rfdetr.training.trainer",
"rfdetr.utilities.distributed",
"rfdetr.utilities.logger",
"rfdetr.utilities.state_dict",
"rfdetr.utilities.tensors",
"rfdetr.variants",
], ignore_errors = true },
]