Ctrl K
ComunidadGuías…

machine-learning/pyproject.toml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
[project]
name = "immich-ml"
version = "3.4.0rc0"
description = ""
authors = [{ name = "Hau Tran", email = "alex.tran1502@gmail.com" }]
requires-python = ">=3.12,<4.0"
readme = "README.md"
dependencies = [
    "fastapi>=0.95.2,<1.0",
    "gunicorn>=21.1.0",
    "huggingface-hub>=1.0,<2.0",
    "immich-model",
    "numpy>=2.4.0,<3.0",
    "onnx>=1.22.0",
    "opencv-python-headless>=4.7.0.72,<5.0",
    "orjson>=3.9.5",
    "pillow>=13,<14",
    "pillow-jxl-plugin>=1.3.8,<2.0",
    "pydantic>=2.0.0,<3",
    "pydantic-settings>=2.5.2,<3",
    "python-multipart>=0.0.6,<1.0",
    "rich>=13.4.2",
    "tokenizers>=0.15.0,<1.0",
    "uvicorn[standard]>=0.22.0,<1.0",
    "rapidocr>=3.1.0",
]

[dependency-groups]
test = [
    "httpx>=0.24.1",
    "pytest>=7.3.1",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.1.0",
    "pytest-mock>=3.11.1",
]
types = [
    "types-pyyaml>=6.0.12.20241230",
    "types-requests>=2.32.0.20250306",
    "types-setuptools>=75.8.2.20250305",
    "types-simplejson>=3.20.0.20250218",
    "types-ujson>=5.10.0.20240515",
]
lint = [
    "mypy>=1.3.0",
    "ruff>=0.0.272",
    { include-group = "types" },
]
dev = ["locust>=2.15.1", { include-group = "test" }, { include-group = "lint" }]
# the image replaces onnxruntime-openvino with one built against and bundling this openvino
onnxruntime-openvino-build = ["openvino==2026.5.0.dev20261005", "setuptools", "wheel"]
# the CUDA libraries the cuda image has in its nvidia/cuda base, for running outside it
cuda-libs = [
    "nvidia-cuda-runtime-cu12==12.2.140 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
    "nvidia-cuda-nvrtc-cu12==12.2.140 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
    "nvidia-cublas-cu12==12.2.5.6 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
    "nvidia-cufft-cu12==11.0.8.103 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
    "nvidia-curand-cu12==10.3.3.141 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
    "nvidia-cudnn-cu12==9.10.2.21 ; sys_platform == 'linux' and platform_machine == 'x86_64'",
]

[project.optional-dependencies]
cpu = ["onnxruntime>=1.23.2,<2"]
cuda = [
  "onnxruntime-gpu>=1.27.1,<1.28", # TODO: last ORT release supporting CUDA 12.2, also need to handle CUDA 13
  "onnxruntime-ep-nv-tensorrt-rtx-cu12>=0.4.0,<0.5 ; platform_machine == 'x86_64'",
]
openvino = ["onnxruntime-openvino>=1.24.1,<2"]
armnn = ["onnxruntime>=1.23.2,<2"]
rknn = ["onnxruntime>=1.23.2,<2"]
rocm = ["onnxruntime-migraphx>=1.23.2,<2"]

[tool.uv]
compile-bytecode = true
override-dependencies = ["opencv-python ; sys_platform == 'never'"] # only install the headless version

[tool.uv.sources]
immich-model = { git = "https://github.com/immich-app/ml-models.git", rev = "f5d9c851010c47324f8fa4cae8a3fd8d0340b90e" }
onnxruntime-gpu = { index = "onnxruntime-cuda-12" }
openvino = { index = "openvino-nightly" }

[[tool.uv.index]]
name = "openvino-nightly"
url = "https://storage.openvinotoolkit.org/simple/wheels/nightly"
explicit = true

[[tool.uv.index]]
name = "onnxruntime-cuda-12"
url = "https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/"
explicit = true


[tool.hatch.build.targets.sdist]
include = ["immich_ml"]

[tool.hatch.build.targets.wheel]
include = ["immich_ml"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.mypy]
python_version = "3.12"
plugins = "pydantic.mypy"
follow_imports = "silent"
warn_redundant_casts = true
disallow_any_generics = true
check_untyped_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

[tool.ruff]
line-length = 120
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I"]
per-file-ignores = { "test_main.py" = ["F403"] }

[tool.pytest.ini_options]
markers = ["providers", "ov_device_ids"]