For the complete documentation index, see llms.txt. This page is also available as Markdown.

V-JEPA 2.1

Train Meta's V-JEPA 2.1 video model for Action Recognition on Roboflow and run it through the Serverless Cloud API

Use Meta's V-JEPA 2.1 self-supervised video model for Action Recognition. Roboflow fine-tunes the ViT-B encoder on your labeled video segments. The trained model returns a timeline of actions: each entry has a class, a start and end frame, and a confidence score. Several actions can overlap in time.

V-JEPA 2.1 is in Beta and needs a paid plan.

Train V-JEPA 2.1

1

Label your videos

Create an Action Recognition Project, upload videos, and label video segments with an action class. Put videos in both the train and valid splits. A test split is optional.

Action Recognition video annotation editor with pick up leg, align leg screw, spin leg, and flip table segments on separate timeline rows
Each segment marks when an action class happens in the video.
2

Start a training

Generate a version and train a model. Pick V-JEPA 2.1 in the training picker.

The recommended video sampling is 384×384 frames, 64 frames per window, and 4 frames per second. Frame size must be a multiple of 16 pixels and the frame count must be even. Each full frame is resized to a square without cropping.

3

Stop or resume

Training stops on its own when validation F1 stops improving. You can stop a training early: it finishes the current epoch and keeps the best checkpoint. You can later continue it from its last checkpoint.

The training summary shows no time or credit estimate for V-JEPA 2.1. Auto-labeling with a V-JEPA 2.1 model is not supported.

V-JEPA 2.1 API

1

Get your API Key

Find your key on the Roboflow API settings page and make it available to your shell:

export ROBOFLOW_API_KEY="your-key-here"
2

Install the dependencies

Install the Inference SDK, version 1.5.2 or newer:

pip install -U inference-sdk
3

Run the model

Send a whole video clip with your trained model's ID (see Versions, Trainings, and Models).

import os
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
).configure(InferenceConfiguration(api_key_transport="header"))

# Replace "your-project/1" with your model ID.
result = client.infer_on_video(
    "https://example.com/video.mp4",
    model_id="your-project/1",
)

for segment in result["timeline"]:
    start = segment["start_frame_idx"] / result["source_fps"]
    end = (segment["end_frame_idx"] + 1) / result["source_fps"]
    print(f"{segment['class']}: {start:.1f}s - {end:.1f}s ({segment['confidence']:.2f})")

Each timeline entry has class, class_id, start_frame_idx, end_frame_idx, and confidence. Frame indices refer to the original video, start at zero, and include both ends. Spans of the same class that touch or overlap merge into one.

infer_on_video also accepts a local file path, but the file is sent as base64, so prefer a URL for long clips. To report only some classes, call client.configure(InferenceConfiguration(class_filter=["walking"])) before inferring.

Set api_url to match your deployment target:

  • https://serverless.roboflow.com for the Serverless Cloud API.

  • http://localhost:9001 for a local Inference server.

  • Your Dedicated Deployment URL for a private endpoint.

Use V-JEPA 2.1 in a Workflow

Add the Action Recognition Model block to a Workflow to run a trained V-JEPA 2.1 model on a video stream. The block buffers frames and outputs a timeline of actions as the stream plays. You can also evaluate the trained model.

Download Weights

You can download a trained V-JEPA 2.1 model as a model.safetensors file. See Download Model Weights.

License

Roboflow's V-JEPA 2.1 code is adapted from Meta's release under the MIT license. See Model Licenses.

Last updated

Was this helpful?