yangyi02 commited on
Commit
3da520b
·
verified ·
1 Parent(s): fb947c7

Fix Quick Start: correct import paths, class names, and install command per actual codebase

Browse files
Files changed (1) hide show
  1. README.md +18 -12
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.torch import tapnextpp
82
 
83
- # Load model
84
- model = tapnextpp.TAPNextPlusPlus()
85
- checkpoint = torch.load("tapnextpp_ckpt.pt", map_location="cpu")
86
- model.load_state_dict(checkpoint)
87
- model.eval()
 
 
 
 
 
 
 
 
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.ParameterizedTAPIR()
100
- checkpoint = torch.load("bootstapir_checkpoint_v2.pt", map_location="cpu")
101
- model.load_state_dict(checkpoint)
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