[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "peepfilt"
version = "0.1.1"
description = "Filter images without people using YOLOv8 (ultralytics)."
readme = "README.md"
authors = [{ name = "Krishnakanth Allika", email = "path-bunt-frays@duck.com" }]
license = "CC-BY-NC-SA-4.0"
requires-python = ">=3.12"
dependencies = [
    "fastapi[all]>=0.127.0",
    "opencv-python>=4.12.0.88",
    "tqdm>=4.67.1",
    "ultralytics>=8.3.241",
]

[project.scripts]
peepfilt = "peepfilt.cli:main"
peepfilt-ui = "peepfilt.api:serve_production"

[project.optional-dependencies]
# Pin to your known-good combos
gpu = [
    "torch==2.5.1+cu121",
    "torchvision==0.20.1+cu121",
    "torchaudio==2.5.1+cu121",
]
cpu = [
    "torch==2.9.1",
    "torchvision==0.24.1",
    "torchaudio==2.9.1",
]

[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
peepfilt = ["frontend/*"]

[tool.uv]
link-mode = "copy"

[[tool.uv.index]]
name = "pytorch-cu121"
url = "https://download.pytorch.org/whl/cu121"
explicit = true

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[tool.uv.sources]
torch = [
    { index = "pytorch-cu121", marker = "extra == 'gpu'" },
    { index = "pytorch-cpu", marker = "extra == 'cpu' and extra != 'gpu'" },
]
torchvision = [
    { index = "pytorch-cu121", marker = "extra == 'gpu'" },
    { index = "pytorch-cpu", marker = "extra == 'cpu' and extra != 'gpu'" },
]
torchaudio = [
    { index = "pytorch-cu121", marker = "extra == 'gpu'" },
    { index = "pytorch-cpu", marker = "extra == 'cpu' and extra != 'gpu'" },
]
