Sitemap
Voxel51

News, tutorials, tips, and big ideas in computer vision and data-centric machine learning, from the company behind open source FiftyOne. Learn more at https://voxel51.com

Visual Understanding with AIMv2

8 min readFeb 11, 2025

--

Source: AIMv2 technical blog

What is AIMv2?

How AIMv2 Differs from CLIP

Source: Figure 1 from the AIMv2 Paper
Source: Figure 1 from the CLIP paper

Technical Architecture

Training Data

Source: Table 2 from the AIMv2 Paper
Source: Figure 5 from Lai et. al.

Practical Applications with FiftyOne

!pip install fiftyone transformers umap-learn

import fiftyone.zoo as foz
import os

dataset = foz.load_zoo_dataset("quickstart")

os.environ["FIFTYONE_ALLOW_LEGACY_ORCHESTRATORS"] = 'true'
!fiftyone plugins download https://github.com/harpreetsahota204/aim-embeddings-plugin

!fiftyone plugins download https://github.com/jacobmarks/zero-shot-prediction-plugin

Feature Extraction and Embedding Visualization with AIMv2 in FiftyOne

import fiftyone.operators as foo

aim_embeddings = foo.get_operator("@harpreetsahota/aimv2_embeddings/compute_aimv2_embeddings")
# Run the operator on your dataset
await embedding_operator(
dataset,
model_name="apple/aimv2-large-patch14–224", # Choose a supported model
embedding_types="cls", # Either "cls" or "mean"
emb_field="aimv2_embeddings", # Name for the field storing embeddings
)
results = fob.compute_visualization(
dataset,
embeddings=embeddings,
method="umap",
brain_key="aim_emb_viz",
num_dims=2,
)
Visualising AIMv2 embeddings in the FiftyOne app

Zero-Shot Classification using AIMv2 in FiftyOne

import fiftyone.operators as foo

zsc = foo.get_operator("@jacobmarks/zero_shot_prediction/zero_shot_classify")
list_of_classes = ["class1", "class2", …, "classn"]
await zsc(
dataset,
labels=list_of_classes,
model_name="AIMv2",
label_field="AIMv2_predictions",
)

Conclusion

--

--

Voxel51
Voxel51

Published in Voxel51

News, tutorials, tips, and big ideas in computer vision and data-centric machine learning, from the company behind open source FiftyOne. Learn more at https://voxel51.com

Harpreet Sahota
Harpreet Sahota

Written by Harpreet Sahota

🤖 Generative AI Hacker | 👨🏽‍💻 AI Engineer | Hacker-in- Residence at Voxel 51

No responses yet