Skip to main content

Cotracker3 Keypoint Tracking

CoTracker3, a keypoint tracking algorithm by Meta, is an ideal example for demonstrating Modal agents. Its moderately sized (100MB) model performs excellently when deployed on Modal with serverless GPU access. Prerequisites
We strongly recommend first completing the general Modal tutorial, which covers registering Encord credentials and provides simpler agent code. This example introduces a new dependency: pulling in model weights and additional ML dependencies.
Additionally, create a virtual environment:
as in the original modal tutorial. Additionally to bring in the CoTracker dependency, we found the most straightforward way to be:
Create the Modal Agent Here is the full code for the Modal Agent.
Create the Modal Agent Once the code is saved as app.py, deploy it using modal deploy app.py.
This agent uses an L4 GPU, incurring usage charges, though it typically operates within Modal’s $5 free allowance.
To trigger the agent, right-click on a keypoint in the Encord platform.