Instructions to use google/tapnet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/tapnet with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("google/tapnet", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix Quick Start: correct import paths, class names, and install command per actual codebase
Browse files
README.md
CHANGED
|
@@ -78,13 +78,21 @@ All checkpoints are released under the **Apache License 2.0**.
|
|
| 78 |
|
| 79 |
```python
|
| 80 |
import torch
|
| 81 |
-
from tapnet.
|
| 82 |
|
| 83 |
-
# Load model
|
| 84 |
-
model =
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
```
|
| 89 |
|
| 90 |
See the [TAPNext++ Colab](https://colab.research.google.com/github/deepmind/tapnet/blob/main/colabs/torch_tapnextpp_demo.ipynb) for a complete demo.
|
|
@@ -96,9 +104,9 @@ import torch
|
|
| 96 |
from tapnet.torch import tapir_model
|
| 97 |
|
| 98 |
# Load model
|
| 99 |
-
model = tapir_model.
|
| 100 |
-
|
| 101 |
-
model.
|
| 102 |
model.eval()
|
| 103 |
```
|
| 104 |
|
|
@@ -107,9 +115,7 @@ See the [PyTorch TAPIR Colab](https://colab.research.google.com/github/deepmind/
|
|
| 107 |
## Installation
|
| 108 |
|
| 109 |
```bash
|
| 110 |
-
pip install tapnet
|
| 111 |
-
# or with PyTorch support
|
| 112 |
-
pip install "tapnet[torch]"
|
| 113 |
```
|
| 114 |
|
| 115 |
## Citation
|
|
|
|
| 78 |
|
| 79 |
```python
|
| 80 |
import torch
|
| 81 |
+
from tapnet.tapnextpp.votsp2026.model import TAPNextPP
|
| 82 |
|
| 83 |
+
# Load model (handles checkpoint parsing internally)
|
| 84 |
+
model = TAPNextPP.from_checkpoint(
|
| 85 |
+
"tapnextpp_ckpt.pt", # or "tapnextpp_512.ckpt" for 512×512
|
| 86 |
+
device="cuda",
|
| 87 |
+
input_resolution=256, # use 512 for the 512×512 checkpoint
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
# Online tracking: first frame with query points
|
| 91 |
+
positions, visible, state = model.track_frame(frame_bgr, query_points_xy=query_xy)
|
| 92 |
+
|
| 93 |
+
# Subsequent frames
|
| 94 |
+
for frame in subsequent_frames:
|
| 95 |
+
positions, visible, state = model.track_frame(frame, state=state)
|
| 96 |
```
|
| 97 |
|
| 98 |
See the [TAPNext++ Colab](https://colab.research.google.com/github/deepmind/tapnet/blob/main/colabs/torch_tapnextpp_demo.ipynb) for a complete demo.
|
|
|
|
| 104 |
from tapnet.torch import tapir_model
|
| 105 |
|
| 106 |
# Load model
|
| 107 |
+
model = tapir_model.TAPIR(pyramid_level=1)
|
| 108 |
+
model.load_state_dict(torch.load("bootstapir_checkpoint_v2.pt"))
|
| 109 |
+
model = model.to(device)
|
| 110 |
model.eval()
|
| 111 |
```
|
| 112 |
|
|
|
|
| 115 |
## Installation
|
| 116 |
|
| 117 |
```bash
|
| 118 |
+
pip install "tapnet[torch] @ git+https://github.com/google-deepmind/tapnet.git"
|
|
|
|
|
|
|
| 119 |
```
|
| 120 |
|
| 121 |
## Citation
|