Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
699 lines (675 loc) · 28.6 KB
/
Copy pathpyproject.toml
File metadata and controls
699 lines (675 loc) · 28.6 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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
[project]
name = "libreyolo"
version = "1.7.4"
description = "MIT-licensed computer vision library: one Python API for YOLO, RF-DETR, RT-DETR and dozens more model families, with training and export where a family supports them."
keywords = [
"yolo",
"object-detection",
"computer-vision",
"pytorch",
"deep-learning",
"instance-segmentation",
"pose-estimation",
"rf-detr",
"rt-detr",
"yolov9",
"yolox",
"onnx",
"mit-license",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Software Development :: Libraries :: Python Modules",
]
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = [
"LICENSE",
"NOTICE",
"THIRD_PARTY_NOTICES.txt",
"weights/LICENSE_NOTICE.txt",
"licenses/Apache-2.0.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",
"mss>=9.0.1",
"tqdm>=4.65.0",
"pycocotools>=2.0.0",
"typer>=0.9.0",
"click>=8.0.0",
"safetensors>=0.4.0",
"scipy>=1.7.0",
# Ephemeral automatic-DDP job transport. Standard pickle validation still
# rejects lambdas/closures; cloudpickle carries transportable __main__
# callbacks without importing and re-running the user's training script.
"cloudpickle>=3.0.0",
# LibreYOLO("owner/repo") loads from the Hugging Face Hub out of the box,
# which the Hub's "Use this model" snippet relies on. Only list_repo_files
# and hf_hub_download are needed, both in 0.x; the bound stays below 1.0
# so the molmo2 extra (transformers 4.57.1 needs huggingface_hub<1.0)
# still resolves. The hf extra keeps >=1.0 for gated-download metadata.
"huggingface_hub>=0.34.0",
]
[dependency-groups]
dev = [
# Below 9 so the dev group resolves next to the executorch extra:
# ExecuTorch 1.2 requires pytest<9 at runtime.
"pytest>=8.3",
"pytest-timeout>=2.3.1",
"pytest-xdist>=3.6",
"ruff>=0.14.10",
"ty>=0.0.1",
]
[project.optional-dependencies]
marigold = [
"diffusers==0.38.0",
"peft==0.18.1",
"accelerate==1.13.0",
"transformers==5.4.0",
"bitsandbytes==0.49.2; platform_system == 'Linux' or platform_system == 'Windows'",
]
stream = [
# YouTube page URLs are resolved lazily to direct media URLs. Webcam,
# RTSP/RTMP/TCP/UDP, HLS, and local multi-stream inputs need no extra.
"yt-dlp",
]
onnx = [
"onnx>=1.14.0",
"onnxsim>=0.4.0",
# Opset-21 runtime floor required by the embedded OpenCV Zoo LaMa graph.
"onnxruntime>=1.18.0",
]
triton = [
# HTTP/HTTPS V2 inference only. gRPC and shared-memory extras are excluded.
"tritonclient[http]>=2.40.0",
]
executorch = [
# Fixed-shape FP32 .pte export and Python runtime validation. Kept out of
# aggregate extras because ExecuTorch constrains the compatible Torch pair.
# Pinned to the validated minor: an unpinned install can resolve
# ExecuTorch 1.0 with an older Torch instead. ExecuTorch 1.2's compiled
# runtime is built against torch 2.11 but only asks for torch>=2.11, so
# pip would pair it with a newer torch whose libc10 the runtime cannot
# load ("Symbol not found"); pin the pair it was built for.
# ExecuTorch 1.2 has no Python 3.14 wheels. The marker skips the stack
# there so pip installs the current LibreYOLO without it instead of
# backtracking to an old release; the export raises a clear error.
"executorch>=1.2,<1.3; python_version < '3.14'",
"torch>=2.11,<2.12; python_version < '3.14'",
"torchvision>=0.26,<0.27; python_version < '3.14'",
]
coreai = [
# Core AI (.aimodel) export, macOS only: the toolchain neither converts
# nor runs elsewhere. Kept out of every aggregate extra on purpose,
# because coreai-torch pins torch to 2.11.x and would drag the whole
# environment onto that version. coreai-torch requires Python 3.11+.
"coreai-torch>=0.4.1; sys_platform == 'darwin' and python_version >= '3.11'",
]
rfdetr = [
"transformers>=5.1.0",
]
eomt = [
"transformers>=5.1.0",
]
midas = [
# MiDaS's official ViT-L/16 and EfficientNet-Lite3 encoders. The bounded
# 1.0 series preserves the checkpoint keys and bitwise parity validated by
# the native port without relying on MiDaS's historical Torch Hub fetch.
"timm>=1.0.28,<1.1",
]
lora = [
# LoRA / PEFT fine-tuning (lora=True) for transformer backbones (RF-DETR).
"libreyolo[rfdetr]",
"peft>=0.12.0",
]
plots = [
"matplotlib>=3.7.0",
]
fast-eval = [
# C++ COCO eval backend. Preferred by default (faster_coco_eval=True) and
# transparently skipped when absent, so this stays an extra rather than a
# hard dependency: it ships compiled wheels, and a source build on a
# platform without one must not be able to break a plain `pip install`.
"faster-coco-eval>=1.7.0",
]
vla = [
# LibreVLA loads vision-language-action policies through the Apache-2.0
# lerobot package (policy classes, processor pipelines, LeRobot datasets).
# lerobot requires Python >= 3.12, so the extra installs nothing on older
# interpreters and the tier raises an ImportError that says so. Kept out
# of `all` for the same reason.
"lerobot[smolvla,diffusion,dataset]>=0.6.1; python_version >= '3.12'",
]
gen = [
# LibreGen loads generative image pipelines (FLUX.2 klein, SANA-Sprint)
# through the Apache-2.0 diffusers package; text encoders come from
# transformers and accelerate backs low-memory loading and offload=True.
# Speridlabs Idol reads DINOv3 through transformers and the FLUX.2 VAE
# through diffusers.
"diffusers>=0.38.0",
"transformers>=5.1.0",
"accelerate>=1.7.0",
]
llm = [
# LibreLLM talks to OpenAI-compatible Responses / Chat Completions
# endpoints through the official Apache-2.0 OpenAI Python SDK.
"openai>=1.66.0",
]
ground = [
# LibreGround (instruction → click) shares the VLM extra stack.
"libreyolo[vlm]",
]
molmo2 = [
# Pinned Molmo2 remote code uses Transformers 4 processor and RoPE APIs.
"transformers==4.57.1",
"einops>=0.8.0",
"accelerate>=0.26.0",
]
vlm = [
# VLM-as-detector and LibreGround 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 has no sdist and wheels only for Linux x86_64 and Windows
# x64, so LocateAnything is unavailable elsewhere; the rest of vlm installs.
"decord==0.6.0; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine == 'AMD64')",
"lmdb>=1.7.0",
"peft>=0.12.0",
]
vlm-train = [
# VLM detection fine-tuning: the vlm inference stack plus PEFT for LoRA.
# peft>=0.17 is the floor the LoRA-adapter save/load contract was
# validated against.
"libreyolo[vlm]",
"peft>=0.17.0",
]
sam = [
# Promptable-segmentation families load through transformers;
# EdgeTAM's RepViT backbone uses Transformers' TimmWrapper.
"transformers>=5.3.0",
"timm>=1.0.23",
]
hub-kernels = [
# Optional runtime loader for compiled Hub kernels (e.g. the
# ms_deform_attn slot). Installing this extra is the opt-in; disable
# with LIBREYOLO_HUB_KERNELS=0. See docs/kernels.md.
"kernels>=0.6.0",
]
openvocab = [
# Discriminative open-vocabulary detectors load through transformers
# (GroundingDinoForObjectDetection / Owlv2ForObjectDetection /
# OmDetTurboForObjectDetection). OMDet-Turbo's configured Swin backbone
# is instantiated through transformers' TimmBackbone.
"transformers>=5.1.0",
"timm>=1.0.0",
# OV-DEIM embeds text prompts with the vendored CLIP BPE tokenizer, which
# needs these at predict time (Unicode \p{L}/\p{N} classes + ftfy fixing).
"regex>=2023.0.0",
"ftfy>=6.0.0",
]
sensenova = [
# SenseNova-Vision (Bagel-MoT): the vendored architecture loads through
# accelerate's big-model dispatch; the tokenizer and activation registry
# come from transformers. flash-attn is optional (SDPA fallback built in).
"transformers>=5.1.0",
"accelerate>=1.7.0",
# 4-bit NF4 loading on consumer GPUs; no macOS wheels.
"bitsandbytes>=0.45.0; sys_platform != 'darwin'",
]
modus = [
# LibreMODUS uses the vendored Bagel/Qwen2/SigLIP architecture and
# accelerate big-model dispatch. No remote code or feature VQ tokenizer
# package is loaded.
"transformers>=5.1.0",
"accelerate>=1.7.0",
]
label = [
# AI-assist for `libreyolo label`: SAM click-to-mask via the LibreSAM tier.
# The manual labeller and model-assisted box auto-label work without this.
"libreyolo[sam]",
]
tensorrt = [
# No CUDA on macOS; marker drops these. Version pin must match the
# [[tool.uv.dependency-metadata]] blocks below. No aarch64 wheels on PyPI:
# Jetson gets TensorRT from JetPack. TensorRT 10.16 publishes no Python
# 3.14 bindings; without the version bound pip backtracks to an old
# LibreYOLO release on 3.14 instead of skipping TensorRT.
"tensorrt-cu12==10.16.1.11; sys_platform != 'darwin' and platform_machine != 'aarch64' and python_version < '3.14'",
# No pycuda: it is sdist only and needs the CUDA toolkit headers to build,
# which broke pip installs. Export and inference use torch.cuda. INT8
# calibration imports cuda.bindings, which PyPI torch already installs on
# Linux; elsewhere it asks for `pip install cuda-python`. Pinning
# cuda-python here would fight torch's own cuda-bindings major version.
]
openvino = [
"openvino>=2024.0.0",
]
paddle = [
"libreyolo[onnx]",
# paddlepaddle 2.6.2 publishes wheels up to Python 3.12 only. The markers
# skip the Paddle stack on 3.13+ so pip installs the current LibreYOLO
# without it instead of backtracking to an old release.
# X2Paddle 1.6.0 imports onnx.mapping, removed after ONNX 1.17.
"onnx>=1.14.0,<1.18; python_version < '3.13'",
# X2Paddle 1.6.0 generates a valid YOLO9 static graph with Paddle 2.6.2.
# Paddle 3.x rejects the generated mixed scalar arithmetic during capture.
"paddlepaddle==2.6.2; python_version < '3.13'",
"x2paddle==1.6.0; python_version < '3.13'",
# Imported by X2Paddle but omitted from its wheel metadata.
"six>=1.16.0; python_version < '3.13'",
]
mnn = [
"libreyolo[onnx]",
"MNN>=3.6.1",
]
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). Every onnx2tf
# release pins ai-edge-litert==2.1.2 and numpy==2.2.6 (or 1.26.4), which
# publish no Python 3.14 wheels, so the converter is skipped there:
# without the upper bound pip backtracks to an old LibreYOLO release.
"onnx2tf>=2.4.3; python_version >= '3.12' and python_version < '3.14'",
# Runtime used by TFLiteBackend to execute exported .tflite artifacts.
# Without onnx2tf's pin it resolves to a release with 3.14 wheels.
"ai-edge-litert>=2.1.2; python_version >= '3.12'",
# Required for the RF-DETR GridSample ONNX graph rewrite (fallback path).
"onnx-graphsurgeon>=0.3.27",
# The RF-DETR onnxsim preprocessing step imports onnxsim, which the onnx
# extra above provides. Not onnx-simplifier: that is an sdist-only
# duplicate of the same module, compiled from C++ and overwriting onnxsim.
]
# LiteRT is Google's current name for TensorFlow Lite; same export path,
# same .tflite output. Separate extra so both names install.
litert = [
"libreyolo[tflite]",
]
# Intentionally empty: all tracking dependencies (e.g. scipy) are core deps,
# so `libreyolo[tracking]` installs nothing extra. Kept for a stable extra name.
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",
]
clip = [
# LibreCLIP towers are native torch (no open_clip at runtime). Only the
# vendored BPE text tokenizer needs these to reproduce CLIP's exact token
# IDs (Unicode \p{L}/\p{N} classes + ftfy text fixing).
"regex>=2023.0.0",
"ftfy>=6.0.0",
]
clip-convert = [
# Convert-/parity-only: re-host OpenCLIP LAION-2B weights as LibreCLIP
# checkpoints (weights/convert_clip_weights.py) and run the parity tests.
"libreyolo[clip]",
"open_clip_torch>=2.24.0",
]
siglip2 = [
# LibreSigLIP2 towers are native torch (no transformers at runtime). Only the
# multilingual SentencePiece text tokenizer (Gemma vocab) needs this.
"sentencepiece>=0.1.99",
]
siglip2-convert = [
# Convert-/parity-only: re-host Apache-2.0 google/siglip2-* weights as
# LibreSigLIP2 checkpoints (weights/convert_siglip2_weights.py) and run the
# parity tests against the reference SiglipModel.
"libreyolo[siglip2]",
"transformers>=5.1.0",
]
coreml = [
# coremltools ships wheels for macOS and Linux x86_64 only (no Windows
# support); CoreML models run on macOS. No release publishes Python 3.14
# wheels yet, and its C++ source build fails without the right toolchain.
"coremltools>=8.0; python_version < '3.14' and (sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'x86_64'))",
]
fiftyone = [
# Dataset curation and prediction analysis (Apache-2.0). Deliberately kept
# out of `all`: fiftyone depends on opencv-python-headless while LibreYOLO
# depends on opencv-python, and both ship the same `cv2` module, so
# installing them together leaves whichever landed last in place. See
# docs/fiftyone.md.
"fiftyone>=1.0.0",
# graphql-core 3.3.0 (2026-09-27) removed graphql.execution.ExecutionContext,
# which strawberry-graphql imports, so `import fiftyone` fails with it.
"graphql-core<3.3",
]
tensorboard = [
"tensorboard>=2.13.0",
]
mlflow = [
"mlflow>=2.9.0",
]
wandb = [
"wandb>=0.16.0",
]
comet = [
"comet-ml>=3.47.1",
]
clearml = [
"clearml>=1.17.0",
]
neptune = [
"neptune-scale>=0.30.0",
]
dvclive = [
"dvclive>=3.49.0",
]
dvc = [
"libreyolo[dvclive]",
]
hf = [
# Hugging Face Hub loading (LibreYOLO("owner/repo")) and push_to_hub.
# v1 adds dry-run byte metadata used to bound gated model downloads.
"huggingface_hub>=1.0.0",
]
all = [
"libreyolo[stream]",
"libreyolo[onnx]",
"libreyolo[triton]",
"libreyolo[rfdetr]",
"libreyolo[eomt]",
"libreyolo[midas]",
"libreyolo[lora]",
"libreyolo[plots]",
"libreyolo[tensorrt]",
"libreyolo[tflite]",
"libreyolo[openvino]",
# paddle is left out: X2Paddle needs onnx<1.18 while onnx2tf (tflite)
# pins onnx 1.20.1 on Python 3.12+, and paddlepaddle 2.6.2 has no Python
# 3.13+ wheels. Install libreyolo[paddle] on its own.
"libreyolo[mnn]",
"libreyolo[ncnn]",
"libreyolo[tracking]",
"libreyolo[rtdetr]",
"libreyolo[gaze]",
"libreyolo[clip]",
"libreyolo[siglip2]",
"libreyolo[coreml]",
"libreyolo[vlm]",
"libreyolo[llm]",
"libreyolo[gen]",
"libreyolo[sam]",
"libreyolo[label]",
"libreyolo[openvocab]",
"libreyolo[sensenova]",
"libreyolo[modus]",
"libreyolo[tensorboard]",
"libreyolo[mlflow]",
"libreyolo[wandb]",
"libreyolo[comet]",
"libreyolo[clearml]",
"libreyolo[dvclive]",
"libreyolo[hf]",
# Keep Neptune separate: stable neptune-scale requires protobuf<7 while
# the TFLite/onnx2tf extra included above requires protobuf 7.
]
[project.scripts]
libreyolo = "libreyolo.cli:entrypoint"
[project.urls]
Homepage = "https://www.libreyolo.com"
Documentation = "https://www.libreyolo.com/docs"
Repository = "https://github.com/LibreYOLO/libreyolo"
Issues = "https://github.com/LibreYOLO/libreyolo/issues"
Changelog = "https://www.libreyolo.com/docs/changelog"
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
libreyolo = [
"assets/*.jpg",
"config/**/*.yaml",
"training/*.yaml",
"data/*.json",
"data/*.txt",
"models/clip/*.gz",
"models/clip/data/*.json",
"models/siglip2/*.model",
"models/siglip2/data/*.json",
"models/darknet/cfgs/*.cfg",
"models/yolo7/*.yaml",
"models/**/NOTICE",
"models/**/LICENSE",
"models/**/*.md",
]
[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]
conflicts = [
[{ extra = "molmo2" }, { extra = "hf" }],
[{ extra = "molmo2" }, { extra = "all" }],
[{ extra = "molmo2" }, { extra = "eomt" }],
[{ extra = "molmo2" }, { extra = "gen" }],
[{ extra = "molmo2" }, { extra = "ground" }],
[{ extra = "molmo2" }, { extra = "label" }],
[{ extra = "molmo2" }, { extra = "lora" }],
[{ extra = "molmo2" }, { extra = "marigold" }],
[{ extra = "molmo2" }, { extra = "modus" }],
[{ extra = "molmo2" }, { extra = "openvocab" }],
[{ extra = "molmo2" }, { extra = "rfdetr" }],
[{ extra = "molmo2" }, { extra = "sam" }],
[{ extra = "molmo2" }, { extra = "sensenova" }],
[{ extra = "molmo2" }, { extra = "siglip2-convert" }],
[{ extra = "molmo2" }, { extra = "vlm" }],
[{ extra = "molmo2" }, { extra = "vlm-train" }],
# lerobot (vla) needs huggingface-hub>=1.6; transformers 4.57.1 needs <1.0.
[{ extra = "molmo2" }, { extra = "vla" }],
[{ extra = "neptune" }, { extra = "tflite" }],
[{ extra = "neptune" }, { extra = "litert" }],
[{ extra = "neptune" }, { extra = "all" }],
# lerobot (vla) needs accelerate>=1.14; marigold pins accelerate 1.13.0.
[{ extra = "marigold" }, { extra = "vla" }],
# X2Paddle needs onnx<1.18; onnx2tf (tflite, in all) pins onnx 1.20.1 and
# protobuf 7, which paddlepaddle 2.6.2 rejects on Windows.
[{ extra = "paddle" }, { extra = "tflite" }],
[{ extra = "paddle" }, { extra = "litert" }],
[{ extra = "paddle" }, { extra = "all" }],
# ExecuTorch 1.2 requires pytest<9 at runtime; onnx2tf (tflite, in all)
# pins pytest 9.0.2. ExecuTorch 1.3+ drops the pin but needs torch 2.12,
# which the cu128 index does not ship.
[{ extra = "executorch" }, { extra = "tflite" }],
[{ extra = "executorch" }, { extra = "litert" }],
[{ extra = "executorch" }, { extra = "all" }],
]
[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",
"libreyolo/models/depth_anything3/_vendor",
]
[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"]
# Only the thread method can interrupt a test wedged inside a native call, such
# as a stalled Hugging Face download; the signal method cannot fire until
# control returns to Python. The limit itself comes from PYTEST_TIMEOUT, which
# the e2e target sets, so unit runs stay unbounded.
timeout_method = "thread"
markers = [
"marigold_v2: Marigold V2 dense prediction tests",
"detany3d: optional DetAny3D promptable 3D detection integration",
"fcos3d: native FCOS3D calibrated 3D detection",
"wilddet3d: optional WildDet3D 3D detection integration",
"mood3d: optional 3D-MOOD open-set 3D detection integration",
"unit: fast tests that avoid external weights or large files",
"vit: tests covering the ViT classification family",
"swin: tests covering the Swin classification family",
"vjepa2: tests covering the V-JEPA 2 video embedding and classification family",
"levjepa: tests covering the LeVJEPA video embedding family",
"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: curated native inference checks in the default nightly",
"flagship_nightly: heavier nightly checks for flagship YOLO9/RF-DETR models",
"cuda_graph: opt-in tests requiring CUDA graph capture and replay",
"extended_training: opt-in multi-epoch or non-core task training tests",
"training_nightly: opt-in GPU checks for training-time CUDA graph capture",
"export_backend: tests covering an export backend or serialized runtime format",
"supported_backend: tests covering a release-blocking supported backend",
"extended_backend: tests covering an extended backend",
"onnx: tests covering ONNX export or inference",
"triton: tests covering NVIDIA Triton HTTP inference",
"torchscript: tests covering TorchScript export or inference",
"executorch: tests requiring the optional ExecuTorch exporter/runtime",
"smoke: fast end-to-end pipeline checks on tiny synthetic data (CPU, <60s)",
"tensorrt: tests requiring TensorRT",
"trt: alias for TensorRT tests requiring TensorRT",
"openvino: tests requiring OpenVINO",
"mnn: tests requiring MNN",
"ncnn: tests requiring ncnn",
"tflite: tests requiring TensorFlow Lite export",
"paddle: tests requiring PaddlePaddle export/runtime",
"coreml: tests requiring CoreML (macOS only)",
"fiftyone: tests requiring the optional FiftyOne integration (fiftyone starts a local MongoDB)",
"yolox: tests covering the YOLOX model family",
"yolo7: tests covering the YOLOv7 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",
"ppyoloe: tests covering the PP-YOLOE model family",
"rfdetr: tests covering the RF-DETR model family",
"detr: tests covering the original DETR model family",
"deit: tests covering the DeiT image-classification family",
"convnextv2: tests covering the ConvNeXt V2 classification family",
"deeplabv3: tests covering the DeepLabv3 semantic segmentation family",
"lwdetr: tests covering the LW-DETR model family",
"faster_rcnn: tests covering the Faster R-CNN model family",
"retinanet: tests covering the RetinaNet model family",
"ssd: tests covering the SSD model family",
"mask_rcnn: tests covering the Mask R-CNN model family",
"fcn: tests covering the FCN semantic-segmentation family",
"ppliteseg: tests covering the PP-LiteSeg semantic-segmentation family",
"unet: tests covering the U-Net semantic-segmentation family",
"fcos: tests covering the FCOS model family",
"deformable_detr: tests covering the Deformable DETR model family",
"dinodetr: tests covering the DINO-DETR model family",
"centernet: tests covering the CenterNet model family",
"dfine: tests covering the D-FINE model family",
"domedetr: tests covering the Dome-DETR tiny-object model family",
"deim: tests covering the DEIM model family",
"deimv2: tests covering the DEIMv2 model family",
"tinyformer: tests covering the TinyFormer model family",
"ec: tests covering the ECDet model family",
"gtr: tests covering the GTR 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",
"efficientdet: tests covering the EfficientDet model family",
"rtmdet: tests covering the RTMDet model family",
"l2cs: tests covering the L2CS gaze estimation family",
"hrnet: tests covering the HRNet top-down pose family",
"dekr: tests covering the DEKR bottom-up pose family",
"fomo: tests covering the LibreFOMO point-localizer family",
"alexnet: tests covering the LibreAlexNet image-classification family",
"vgg: tests covering the LibreVGG classification family",
"vlm: tests covering the LibreVLM (VLM-as-detector) tier",
"llm: tests covering the LibreLLM OpenAI-compatible client",
"vla: tests covering the LibreVLA (vision-language-action) tier",
"gen: tests covering the LibreGen (generative image) tier",
"sam: tests covering the LibreSAM (promptable-segmentation) tier",
"openvocab: tests covering the LibreOpenVocab detector tier",
"sensenova: tests covering the LibreSenseNovaVision unified multimodal family",
"modus: tests covering the external-weight LibreMODUS any-to-any family",
"clip: tests covering the LibreCLIP zero-shot open-vocabulary classifier family",
"siglip2: tests covering the LibreSigLIP2 zero-shot open-vocabulary classifier family",
"pe: tests covering the LibrePE Perception Encoder Core zero-shot / embedding family",
"midas: tests covering the MiDaS relative-depth family",
"quicksrnet: tests covering the QuickSRNet super-resolution family",
"ddcolor: tests covering the DDColor automatic-colorization family",
"hvi_cidnet: tests covering the HVI-CIDNet low-light restoration family",
"lama: tests covering the LaMa mask-guided inpainting family",
"vitmatte: tests covering the ViTMatte trimap-guided matting family",
"distributed: multi-rank gloo tests that mp.spawn a process group. Linux-only in the PR gate: they exercise distributed-training math, which is platform-independent, while dist.init_process_group(backend='gloo') costs ~105s per test on the macOS runner (a bare 2-rank scalar all-reduce takes 109s there vs 3.9s on Linux). They also compare a parent-process reference gradient against child-process gradients at a BLAS-sensitive tolerance, so running them on every OS yields flakes rather than coverage. The spawn-plumbing tests are deliberately NOT marked: they cover spawn-only failure modes that Linux's fork never hits.",
"rf1: RF1 training tests",
"rf5: RF5 training benchmark tests",
"slow: slow tests that may take several minutes",
]