New advertisers: 50% off your first month with code FIRSTMONTHSee slots
reason-machines avatar

Tribev2 Brain Encoding

Loads Meta's TRIBE v2 model to predict fMRI cortical responses to video, audio, and text stimuli.

skills.sh installs
764
GitHub stars
98
last updated
Jul 14, 2026
View on GitHub

What it does

  • Covers inference from pretrained weights, multimodal event building, brain surface visualization, and training from scratch on Slurm
  • Includes TribeModel API calls, ROI masking on the fsaverage5 surface, and batch prediction over multiple videos
  • Requires LLaMA 3.2 access approval on HuggingFace before running the text encoder
  • Designed for neuroscience researchers modeling naturalistic stimuli against fMRI data on fsaverage5 (~20k vertices)

Install

$ npx -y skills add reason-machines/trending-skills --skill tribev2-brain-encoding -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

TRIBE v2 Brain Encoding Model

Skill by ara.so — Daily 2026 Skills collection

TRIBE v2 is Meta's multimodal foundation model that predicts fMRI brain responses to naturalistic stimuli (video, audio, text). It combines LLaMA 3.2 (text), V-JEPA2 (video), and Wav2Vec-BERT (audio) encoders into a unified Transformer architecture that maps multimodal representations onto the cortical surface (fsaverage5, ~20k vertices).

Installation

# Inference only
pip install -e .

# With brain visualization (PyVista & Nilearn)
pip install -e ".[plotting]"

# Full training dependencies (PyTorch Lightning, W&B, etc.)
pip install -e ".[training]"

Quick Start — Inference

Load pretrained model and predict from video

from tribev2 import TribeModel

# Load from HuggingFace (downloads weights to cache)
model = TribeModel.from_pretrained("facebook/tribev2", cache_folder="./cache")

# Build events dataframe from a video file
df = model.get_events_dataframe(video_path="path/to/video.mp4")

# Predict brain responses
preds, segments = model.predict(events=df)
print(preds.shape)  # (n_timesteps, n_vertices) on fsaverage5

Details

Repository
github.com/reason-machines/trending-skills
Categories
Research & Academic, Data Science & Analytics
First seen
May 16, 2026

More from reason-machines/trending-skills

All 163

Similar to Tribev2 Brain Encoding

More Research & Academic