-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathpyproject.toml
More file actions
276 lines (257 loc) · 8.72 KB
/
Copy pathpyproject.toml
File metadata and controls
276 lines (257 loc) · 8.72 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
[project]
name = "libreyolo"
version = "1.2.0.dev0"
description = "Libre YOLO - An open source YOLO library with MIT license."
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = [
"LICENSE",
"NOTICE",
"THIRD_PARTY_NOTICES.txt",
"weights/LICENSE_NOTICE.txt",
]
authors = [
{name = "LibreYOLO Team"}
]
dependencies = [
"numpy>=1.19.0",
"Pillow>=9.1.0",
"torch>=2.4.0",
"torchvision>=0.19.0",
"PyYAML>=6.0",
"requests>=2.25.0",
"opencv-python>=4.11.0.86",
"tqdm>=4.65.0",
"pycocotools>=2.0.0",
"typer>=0.9.0",
"click>=8.0.0",
"safetensors>=0.4.0",
"scipy>=1.7.0",
]
[dependency-groups]
dev = [
"pytest>=9.0.2",
"ruff>=0.14.10",
"ty>=0.0.1",
]
[project.optional-dependencies]
onnx = [
"onnx>=1.14.0",
"onnxsim>=0.4.0",
"onnxruntime>=1.16.0",
]
rfdetr = [
"transformers>=5.1.0",
]
lora = [
# LoRA / PEFT fine-tuning (lora=True) for transformer backbones (RF-DETR).
"libreyolo[rfdetr]",
"peft>=0.12.0",
]
plots = [
"matplotlib>=3.7.0",
]
vlm = [
# VLM-as-detector families load through transformers.
# huggingface_hub (used for snapshot download) ships with transformers.
"transformers>=5.1.0",
# SmolVLM2's processor requires num2words.
"num2words>=0.5.0",
# LocateAnything's HF remote-code processor/model imports these at load time.
"decord==0.6.0",
"lmdb>=1.7.0",
"peft>=0.12.0",
]
sam = [
# Promptable-segmentation families (SAM) load through transformers
# (SamModel/SamProcessor); huggingface_hub ships with it.
"transformers>=5.1.0",
]
tensorrt = [
# No CUDA on macOS; marker drops these. Version pin must match the
# [[tool.uv.dependency-metadata]] blocks below.
"tensorrt-cu12==10.16.1.11; sys_platform != 'darwin'",
"pycuda>=2022.1; sys_platform != 'darwin'",
]
openvino = [
"openvino>=2024.0.0",
]
ncnn = [
"pnnx",
"ncnn",
]
tflite = [
"libreyolo[onnx]",
# onnx2tf 2.4.3 includes the RF-DETR conversion fixes required by this path.
# Requires Python 3.12+ (onnx2tf 2.4.x wheel constraint).
"onnx2tf>=2.4.3; python_version >= '3.12'",
# Required for the RF-DETR GridSample ONNX graph rewrite (fallback path).
"onnx-graphsurgeon>=0.3.27",
# Required for RF-DETR onnxsim preprocessing step.
"onnx-simplifier>=0.4.36",
]
tracking = []
rtdetr = []
gaze = [
# Enables best-effort auto-download of the L2CS Gaze360 checkpoint from
# the official Google Drive (large-file confirm-token handling). Without
# it, LibreL2CS prints manual download instructions instead.
"gdown>=5.1.0",
]
coreml = [
"coremltools>=8.0",
]
tensorboard = [
"tensorboard>=2.13.0",
]
mlflow = [
"mlflow>=2.9.0",
]
wandb = [
"wandb>=0.16.0",
]
all = [
"libreyolo[onnx]",
"libreyolo[rfdetr]",
"libreyolo[lora]",
"libreyolo[plots]",
"libreyolo[tensorrt]",
"libreyolo[tflite]",
"libreyolo[openvino]",
"libreyolo[ncnn]",
"libreyolo[tracking]",
"libreyolo[rtdetr]",
"libreyolo[gaze]",
"libreyolo[coreml]",
"libreyolo[vlm]",
"libreyolo[sam]",
"libreyolo[tensorboard]",
"libreyolo[mlflow]",
"libreyolo[wandb]",
]
[project.scripts]
libreyolo = "libreyolo.cli:entrypoint"
[project.urls]
Homepage = "https://github.com/LibreYOLO"
Repository = "https://github.com/LibreYOLO/libreyolo"
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
libreyolo = [
"assets/*.jpg",
"config/**/*.yaml",
"training/*.yaml",
]
[tool.setuptools.packages.find]
include = ["libreyolo*"]
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
# tensorrt-cu12 is sdist-only and its setup.py refuses to run on macOS, so
# uv's universal lock can't extract its metadata on darwin hosts. Static
# metadata lets uv resolve the non-darwin fork without building. Bump in
# lockstep with the version pin in [project.optional-dependencies].tensorrt.
# Pull torch/torchvision from the PyTorch CUDA 12.8 index on Linux/Windows so
# `uv sync` produces a GPU-enabled environment by default. macOS keeps the
# PyPI default (CPU/MPS wheel) since download.pytorch.org has no darwin builds.
# Requires NVIDIA driver >= 555 (CUDA 12.8 runtime) on the host.
[tool.uv.sources]
torch = [
{ index = "pytorch-cu128", marker = "sys_platform != 'darwin'" },
]
torchvision = [
{ index = "pytorch-cu128", marker = "sys_platform != 'darwin'" },
]
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[[tool.uv.dependency-metadata]]
name = "tensorrt-cu12"
version = "10.16.1.11"
requires-dist = [
"tensorrt-cu12-libs==10.16.1.11",
"tensorrt-cu12-bindings==10.16.1.11",
]
requires-python = ">=3.8"
[[tool.uv.dependency-metadata]]
name = "tensorrt-cu12-libs"
version = "10.16.1.11"
requires-dist = []
[[tool.uv.dependency-metadata]]
name = "tensorrt-cu12-bindings"
version = "10.16.1.11"
requires-dist = []
[tool.ruff]
# Vendored from upstream DEIMv2. Keep local lint focused on the LibreYOLO
# wrapper/integration code instead of rewriting third-party implementation files.
extend-exclude = ["libreyolo/models/deimv2/engine"]
[tool.ty.rules]
# Rules that catch real bugs — keep as errors
invalid-parameter-default = "error"
# Rules that produce false positives with PyTorch nn.Module dynamic attrs
# and C extensions without type stubs (tensorrt, ncnn, pycuda).
# Downgrade to warnings so they don't block CI but remain visible.
unresolved-import = "warn" # optional deps not installed in dev env
unresolved-attribute = "warn" # nn.Module.__getattr__, C extension members
invalid-argument-type = "warn" # torch.onnx.export kwargs, tensor ops
not-subscriptable = "warn" # tensor[int] operations
unsupported-operator = "warn" # tensor arithmetic
not-iterable = "warn" # Module/tensor iterations
call-non-callable = "warn" # Module.__call__
invalid-method-override = "warn" # template method + nn.Module patterns
invalid-assignment = "warn" # nn.Module dynamic attrs, tensor ops
invalid-return-type = "warn" # torch return type inference
index-out-of-bounds = "warn" # tensor indexing
unknown-argument = "warn" # dynamic kwargs patterns
no-matching-overload = "warn" # torch overloaded functions
possibly-missing-attribute = "warn"
[[tool.ty.overrides]]
include = ["vision_analysis_benchmark/**", "tests/**"]
[tool.ty.overrides.rules]
# Benchmark and test code: suppress all to avoid noise
unresolved-import = "ignore"
[tool.pytest.ini_options]
addopts = "-m unit"
testpaths = ["tests"]
markers = [
"unit: fast tests that avoid external weights or large files",
"external_data: tests that require external datasets, weights, or staged large files",
"network: tests that intentionally use non-local network access",
"e2e: end-to-end tests requiring full model loading and inference",
"general_nightly: broad nightly inference checks across all model families",
"flagship_nightly: heavier nightly checks for flagship YOLO9/RF-DETR models",
"export_backend: tests covering an export backend or serialized runtime format",
"supported_backend: tests covering a release-blocking supported backend",
"experimental_backend: tests covering an experimental backend",
"onnx: tests covering ONNX export or inference",
"torchscript: tests covering TorchScript export or inference",
"tensorrt: tests requiring TensorRT",
"trt: alias for TensorRT tests requiring TensorRT",
"openvino: tests requiring OpenVINO",
"ncnn: tests requiring ncnn",
"tflite: tests requiring TensorFlow Lite export",
"coreml: tests requiring CoreML (macOS only)",
"yolox: tests covering the YOLOX model family",
"yolo9: tests covering the YOLO9 model family",
"yolo9_e2e: tests covering the YOLOv9-E2E model family",
"yolonas: tests covering the YOLO-NAS model family",
"rfdetr: tests covering the RF-DETR model family",
"dfine: tests covering the D-FINE model family",
"deim: tests covering the DEIM model family",
"deimv2: tests covering the DEIMv2 model family",
"ec: tests covering the ECDet model family",
"rtdetr: tests covering the RT-DETR model family",
"rtdetrv2: tests covering the RT-DETRv2 model family",
"rtdetrv4: tests covering the RT-DETRv4 model family",
"picodet: tests covering the PICODET model family",
"rtmdet: tests covering the RTMDet model family",
"l2cs: tests covering the L2CS gaze estimation family",
"fomo: tests covering the LibreFOMO point-localizer family",
"vlm: tests covering the LibreVLM (VLM-as-detector) tier",
"sam: tests covering the LibreSAM (promptable-segmentation) tier",
"rf1: RF1 training tests",
"rf5: RF5 training benchmark tests",
"slow: slow tests that may take several minutes",
]