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.
Train V-JEPA 2.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.

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.
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
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"Install the dependencies
Install the Inference SDK, version 1.5.2 or newer:
pip install -U inference-sdkRun 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.
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?