[project] name = "parking-trainer" version = "0.0.0" description = "Phase-B body-type classifier trainer: reviewer labels + crops off the wash collector's volume → an ONNX classifier the vision image bakes in." requires-python = ">=3.10,<4.0" # Core deps are LIGHT on purpose (same rule as the vision service): `inspect`, `evaluate` # and the data/report code run with only these, so `uv sync` and the test suite work # in CI without the PyTorch stack. Training itself needs the `train` extra. # See wiki/decisions/bodytype-classifier-training.md. dependencies = [ "numpy>=1.26", # OpenCV does the decode + resize on BOTH sides (trainer and vision service): same # library, same interpolation, same pixels — the preprocessing contract (preprocess.py). "opencv-python-headless>=4.10", "onnxruntime>=1.19", ] [project.scripts] parking-trainer = "trainer.cli:main" [project.optional-dependencies] # The training stack. CPU-only PyTorch (the reviewer's host has no usable GPU — the # decision is recorded in the wiki page above): resolved from PyTorch's CPU wheel index, # ~200 MB instead of the ~5 GB CUDA build. Install with: uv sync --extra train # torch / torchvision are BSD-3; the ImageNet backbone weights ship under the same # licence (the licence rule applies to weights as much as code). train = [ "torch>=2.4", "torchvision>=0.19", "onnx>=1.16", "onnxscript>=0.3", # the torch.export-based ONNX exporter (MIT) ] [dependency-groups] dev = [ "ruff>=0.8", "pytest>=8.3", "mypy>=1.13", ] [tool.uv] # Pick the CPU wheels for torch/torchvision from PyTorch's own index; everything else # from PyPI. `explicit = true` keeps the index from shadowing PyPI for other packages. [[tool.uv.index]] name = "pytorch-cpu" url = "https://download.pytorch.org/whl/cpu" explicit = true [tool.uv.sources] torch = [{ index = "pytorch-cpu" }] torchvision = [{ index = "pytorch-cpu" }] [tool.ruff] line-length = 110 target-version = "py310" [tool.ruff.lint] select = ["E", "F", "I", "B", "UP"] [tool.pytest.ini_options] testpaths = ["tests"] [tool.mypy] python_version = "3.12" strict = true ignore_missing_imports = true [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["trainer"]