Model reference · open weights
C-RADIO is an open-weight embedding model from nvidia. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | NVIDIA |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 652M |
| Runs with | transformers |
| Released | 2024-05-29 |
| Popularity | 13k downloads / month |
| Licence | Commercial licence needed |
About
This model performs visual feature extraction. For instance, RADIO generates image embeddings that can be used by a downstream model to classify images.
[License] This model is governed by the NVIDIA Open Model License Agreement.
AM-RADIO: Agglomerative Vision Foundation Model - Reduce All Domains Into One
PHI-S: Distribution Balancing for Label-Free Multi-Teacher Distillation
RADIO Amplified: Improved Baselines for Agglomerative Vision Foundation Models
Architecture Type: Neural Network Network Architecture: Vision Transformer
Input Type(s): Image Input Format(s): Red, Green, Blue (RGB) pixel values in [0, 1] range. Input Parameters: Two Dimensional (2D) Other Properties Related to Input: Image resolutions up to 2048x2028 in increments of 16 pixels
Output Type(s): Embeddings Output Format: Tensor Output Parameters: 2D Other Properties Related to Output: Downstream model required to leverage image features
RADIO will return a tuple with two tensors.
The summary is similar to the cls_token in ViT and is meant to represent the general concept of the entire image.
It has shape (B,C) with B being the batch dimension, and C being some number of channels.
The spatial_features represent more localized content which should be suitable for dense tasks such as semantic segmentation, or for integration into an LLM.
import torch
from PIL import Image
from transformers import AutoModel, CLIPImageProcessor
hf_repo = "nvidia/C-RADIO"
image_processor = CLIPImageProcessor.from_pretrained(hf_repo)
model = AutoModel.from_pretrained(hf_repo, trust_remote_code=True)
model.eval().cuda()
image = Image.open('./assets/radio.png').convert('RGB')
pixel_values = image_processor(images=image, return_tensors='pt', do_resize=True).pixel_values
pixel_values = pixel_values.cuda()
summary, features = model(pixel_values)
Spatial features have shape (B,T,D) with T being the flattened spatial tokens, and D being the channels for spatial features. Note that C!=D in general.
Converting to a spatial tensor format can be done using the downsampling size of the model, combined with the input tensor shape. For RADIO, the patch size is 16.
from einops import rearrange
spatial_features = rearrange(spatial_features, 'b (h w) d -> b d h w', h=x.shape[-2] // patch_size, w=x.shape[-1] // patch_size)
The resulting tensor will have shape (B,D,H,W), as is typically seen with computer vision models.
Runtime Engine(s):
Supported Hardware Microarchitecture Compatibility:
[Preferred/Supported] Operating System(s):
C-RADIO.
Link: https://huggingface.co/nvidia/C-RADIO
NV-CC-Img-Text-Dataset ** Data Collection Method by dataset
Link: ImageNet ** Data Collection Method by dataset
Properties: This dataset spans 1000 object classes and contains 1,281,167 training images, 50,000 validation images and 100,000 test images.
Engine: PyTorch Test Hardware: A100
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse. Users should evaluate the model for safety and quality for a specific use case and build additional guardrails as appropriate.
Please report security vulnerabilities or NVIDIA AI Concerns here.
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys c-radio for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (c-radio below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"c-radio","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.