PE-AV is a state-of-the-art multimodal model that embeds audio, video, audio-video, and text into a joint embedding space. The model enables powerful cross-modal retrieval and understanding across audio, video, and text modalities.
Model Description
PE-AV is trained using contrastive learning to align audio, video, and text representations in a shared embedding space. The model can encode:
Audio only
: Extract audio embeddings from audio waveforms
Video only
: Extract visual embeddings from video frames
import torch
from core.audio_visual_encoder import PEAudioVisual, PEAudioVisualTransform
device = torch.device("cuda"if torch.cuda.is_available() else"cpu")
# Load model and transform
model = PEAudioVisual.from_config("pe-av-large", pretrained=True).to(device)
transform = PEAudioVisualTransform.from_config("pe-av-large")
video_files = ["video1.mp4", "video2.mp4"]
descriptions = ["description1", "description2"]
audio_files = ["audio1.wav", "audio2.wav"]
# Process inputs and get embeddings
inputs = transform(videos=video_files, text=descriptions, audio=audio_files).to(device)
with torch.inference_mode(), torch.autocast(device.type, dtype=torch.bfloat16):
outputs = model(**inputs)
# Access different embeddings
audio_embeds = outputs.audio_embeds # Audio-only embeddings
visual_embeds = outputs.visual_embeds # Video-only embeddings
audio_visual_embeds = outputs.audio_visual_embeds # Joint audio-visual embeddings
audio_text_embeds = outputs.audio_text_embeds # Text embeddings aligned to audio
visual_text_embeds = outputs.visual_text_embeds # Text embeddings aligned to video
audio_visual_text_embeds = outputs.audio_visual_text_embeds # Text embeddings aligned to audio-visual
audio_plus_text_embeds = outputs.audio_plus_text_embeds # Joint audio and text embedding
visual_plus_text_embeds = outputs.visual_plus_text_embeds # Joint video and text embedding# Compute the dot product to get their similarities
audio_visual_similarity = audio_embeds @ visual_embeds.T
# When computing similarity against text embeddings, use the# appropriate text embedding based on the other modality
audio_text_similarity = audio_embeds @ audio_text_embeds.T
video_text_similarity = visual_embeds @ visual_text_embeds.T
Note that you can omit any of the modalities, and use the same
forward
method. The corresponding embeddings in
output
will be
None
. For example:
from transformers import PeAudioVideoModel, PeAudioVideoProcessor
import torch
device = torch.device("cuda"if torch.cuda.is_available() else"cpu")
model = PeAudioVideoModel.from_pretrained("facebook/pe-av-large")
processor = PeAudioVideoProcessor.from_pretrained("facebook/pe-av-large")
model = model.to(device)
video_files = ["video1.mp4", "video2.mp4"]
descriptions = ["description1", "description2"]
audio_files = ["audio1.wav", "audio2.wav"]
# Process inputs and get embeddings
inputs = processor(
videos=video_files, text=descriptions, audio=audio_files, return_tensors="pt", padding=True
)
with torch.inference_mode(), torch.autocast(device.type, dtype=torch.bfloat16):
outputs = model(**inputs.to(device), return_loss=True)
audio_embeds = outputs.audio_embeds # Audio-only embeddings
video_embeds = outputs.video_embeds # Video-only embeddings
audio_video_embeds = outputs.audio_video_embeds # Joint audio-video embeddings
text_audio_video_embeds = outputs.audio_video_text_embeds # Text embeddings aligned to audio-video
text_audio_embeds = outputs.text_audio_embeds # Text embeddings aligned to audio
text_video_embeds = outputs.text_video_embeds # Text embeddings aligned to video
audio_plus_text_embeds = outputs.audio_plus_text_embeds # Joint audio and text embedding
video_plus_text_embeds = outputs.video_plus_text_embeds # Joint video and text embedding# For classification, you can use the logits_* fields of the output
audio_text_preds = outputs.logits_audio_text.sigmoid()
# The overall loss is also available in the output (requires passing return_loss=True)
loss = outputs.loss
We also provide methods for directly encoding an individual modality:
@article{pe-av2025,
title={PEAV: An Audiovisual Perception Encoder via Large-Scale Multimodal Correspondence Learning},
author={Apoorv Vyas, Heng-Jui Chang, Cheng-Fu Yang, Po-Yao Huang, Luya Gao, Julius Richter, Sanyuan Chen, Matt Le, Piotr Dollár, Christoph Feichtenhofer, Ann Lee, Wei-Ning Hsu},
url={arxiv link coming soon}
year={2025}
}
License
This model is released under the Apache 2.0 license.
Runs of facebook pe-av-large on huggingface.co
70.7K
Total runs
465
24-hour runs
817
3-day runs
817
7-day runs
50.4K
30-day runs
More Information About pe-av-large huggingface.co Model
pe-av-large huggingface.co is an AI model on huggingface.co that provides pe-av-large's model effect (), which can be used instantly with this facebook pe-av-large model. huggingface.co supports a free trial of the pe-av-large model, and also provides paid use of the pe-av-large. Support call pe-av-large model through api, including Node.js, Python, http.
pe-av-large huggingface.co is an online trial and call api platform, which integrates pe-av-large's modeling effects, including api services, and provides a free online trial of pe-av-large, you can try pe-av-large online for free by clicking the link below.
facebook pe-av-large online free url in huggingface.co:
pe-av-large is an open source model from GitHub that offers a free installation service, and any user can find pe-av-large on GitHub to install. At the same time, huggingface.co provides the effect of pe-av-large install, users can directly use pe-av-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.