MCPcopy Index your code
hub / github.com/brentyi/pips-jax

github.com/brentyi/pips-jax @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
35 symbols 128 edges 7 files 16 documented · 46%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pips-jax

JAX port of the PIPs model for tracking point trajectories.

@inproceedings{harley2022particle,
  title={Particle Video Revisited: Tracking Through Occlusions Using Point Trajectories},
  author={Adam W Harley and Zhaoyuan Fang and Katerina Fragkiadaki},
  booktitle={ECCV},
  year={2022}
}

We currently include:

  • Model implementation using flax.
  • JAX version of PIPs's 12/15/22 reference checkpoint.
  • PyTorch -> JAX checkpoint translation script.

Setup

Clone and install (you may want to install JAX with GPU support first):

git clone https://github.com/brentyi/pips-jax.git
cd pips-jax
pip install -e .

Un-split reference checkpoint:

# Full checkpoints surpass GitHub's maximum file size, so we split the reference
# checkpoint into several parts.
cat checkpoints/reference_model/checkpoint_200000.* > checkpoints/reference_model/checkpoint_200000

Runnable scripts:

  • python convert_checkpoint.py --help: Conversion script for converting the PIPs reference PyTorch checkpoint for use in Flax.
  • python demo.py --help: Loose reproduction of the original PIPs model's demo script. Loads images and writes GIFs:

demo_image_000

  • python benchmark.py --help: Benchmarking script for the JAX model's forward pass. Runtimes in seconds for a single forward pass[^1] compared to PyTorch:
JAX 0.4.1 PyTorch 1.13 PyTorch 2.0 PyTorch 2.0 + torch.compile()
RTX 4090 0.03111±0.00 0.09892±0.02

0.07652±0.02 | 0.09922±0.02

0.08653±0.03 | (probably fast but ran into CUDA errors!) | | RTX 2080 TI | 0.10610±0.00 | 0.17770±0.01

0.15659±0.02 | 0.19143±0.02

0.15634±0.02 | 0.12979±0.00

0.11968±0.00 |

For generating PyTorch timings, see this script. Note that each PyTorch cell has two timings: the first is the PIPs code as released, and the second is the PIPs code with logic corresponding to fcp commented out. This is only used for training and visualization.

[^1]: 8 image subsequence, 640x360, 256 points, stride=4, iters=6.

Core symbols most depended-on inside this repo

init_params
called by 3
src/pips_jax/model.py
_feedforward
called by 2
src/pips_jax/model.py
run_model
called by 1
demo.py
_initialize_tracking
called by 1
src/pips_jax/model.py
_iterative_update_step
called by 1
src/pips_jax/model.py
_make_layer
called by 1
src/pips_jax/model.py
get_3d_embedding
called by 1
src/pips_jax/model.py
benchmark
called by 0
benchmark.py

Shape

Method 15
Function 12
Class 8

Languages

Python100%

Modules by API surface

src/pips_jax/model.py20 symbols
benchmark.py5 symbols
src/pips_jax/utils_bilerp.py4 symbols
src/pips_jax/utils_pyramid.py3 symbols
demo.py2 symbols
convert_checkpoint.py1 symbols

For agents

$ claude mcp add pips-jax \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page