Download code/tt_sam3/__init__.py from changh95/sam3-p150: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/changh95/sam3-p150/resolve/main/code/tt_sam3/__init__.py
- Command line
-
hf download hf://changh95/sam3-p150/code/tt_sam3/__init__.py
-
curl -L -o __init__.py https://huggingface.co/changh95/sam3-p150/resolve/main/code/tt_sam3/__init__.py
888 Bytes
| # SPDX-FileCopyrightText: (c) 2026 Tenstorrent AI ULC | |
| # SPDX-License-Identifier: Apache-2.0 | |
| """SAM3 (text-prompted open-vocabulary instance segmentation) on a Tenstorrent Blackhole chip. | |
| from tt_sam3 import Sam3 | |
| with Sam3.from_pretrained(device_id=0) as model: | |
| result = model("photo.jpg", "car") # Sam3Result: masks (N, H, W) bool, boxes (N, 4) xyxy px, scores (N,) | |
| See ``PYTHON.md`` for the full API. ``import tt_sam3`` is cheap: torch / ttnn load on first use of ``Sam3``. | |
| """ | |
| __version__ = "0.1.0" | |
| __all__ = ["Sam3", "Sam3Result", "load_image", "device_open_kwargs", "PINNED_REVISION", "__version__"] | |
| def __getattr__(name): | |
| if name in ("Sam3", "Sam3Result", "load_image", "device_open_kwargs", "PINNED_REVISION"): | |
| from tt_sam3 import api | |
| return getattr(api, name) | |
| raise AttributeError(f"module 'tt_sam3' has no attribute {name!r}") | |