File size: 3,148 Bytes
b7e49b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# SPDX-License-Identifier: Apache-2.0
# Python package of DepthPro2 (changh95/DepthPro2), from the ROOT of the model repo:
#     pip install -e .                    # the Python API
#     pip install -e ".[server,test]"     # + the HTTP server and the tests
#
# Install it into an environment that already has tt-metal's ttnn (and its torch 2.11.0+cpu): ttnn and torch are NOT
# declared, so pip never replaces the tt-metal build's own torch. The container image installs the same set through
# tt-model.yaml runtime.packages (pinned there to the versions the gates ran with).
#
# This file lives at the repo root ON PURPOSE and must never move into code/: tt-model copies code/ over /opt/tt-metal
# right before `uv pip install -e /opt/tt-metal` in the image build, so a code/pyproject.toml would replace tt-metal's
# own (project ttnn) and break `import ttnn` in the image. It is not in tt-model.yaml extra_code: it reaches the Hub as
# an overlay file next to the generated README.md.
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"

[project]
name = "tt-depthpro2"
dynamic = ["version"]            # tt_depthpro2.__version__, the version /openapi.json reports
description = "Apple Depth Pro 2 (S, B, L, H+) metric depth on Tenstorrent Blackhole p150 (tt-nn), with a Python API and an HTTP server"
readme = "code/PYTHON.md"
license = "Apache-2.0"           # the port's code; the weights (not included) are under Apple's research-only licence
requires-python = ">=3.10"
dependencies = [
    "numpy>=1.24.4,<2",          # ttnn needs numpy 1.x
    "pillow",                    # image decoding, 16-bit PNG output
    "safetensors",               # apple/DepthPro2-* model.safetensors
    "huggingface_hub",           # weights pointers: apple/DepthPro2-{S,B,L,H,focal} at pinned commits
]

[project.optional-dependencies]
server = ["fastapi", "uvicorn", "pydantic>=2"]
test = ["pytest", "httpx"]

[project.urls]
"Model card" = "https://huggingface.co/changh95/DepthPro2"
"Weights" = "https://huggingface.co/apple/DepthPro2"
"Official code" = "https://github.com/apple-aiml-research/ml-depth-pro-2"

[tool.setuptools.dynamic]
version = { attr = "tt_depthpro2.__version__" }

[tool.setuptools.packages.find]
where = ["code"]                  # import root (code/conftest.py and code/scripts/ are not packaged)
include = ["tt_depthpro2*"]       # with the vendored tt_depthpro2.ttaw (common/tools/vendor.py; never edit it)
exclude = ["tt_depthpro2.tests*"]

[tool.setuptools.package-data]
"tt_depthpro2" = ["samples/*/*", "licenses/*"]
"tt_depthpro2.tt" = ["kernels/*"]                                  # device kernels, JIT-compiled at the first start
"tt_depthpro2.tt.mk_enc" = ["kernels/*.cpp", "kernels/*.hpp", "kernels/*.h"]
"tt_depthpro2.tt.mk_dec" = ["kernels/*.cpp", "kernels/*.hpp", "kernels/*.h"]
"tt_depthpro2.tt.mk_fov" = ["kernels/*.cpp", "kernels/*.hpp", "kernels/*.h"]
"tt_depthpro2.ttaw" = ["API.md", "VENDORED.json"]
"tt_depthpro2.ttaw.ops" = ["kernels/*.cpp", "kernels/*.hpp", "kernels/*.h"]

[tool.pytest.ini_options]
markers = ["device: needs a Tenstorrent chip (skipped on host-only runs)"]