Model reference · open weights

defm

Embeddings leggedrobotics Image embed 1 build Open weights 527 dl/mo

defm is an open-weight embedding model from leggedrobotics. defm (BF16) weighs 1.2 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • DeFM is a vision backbone developed by leggedrobotics for image feature extraction from depth images.
  • It is designed for robotic perception tasks such as navigation, manipulation, and locomotion.
  • The model family includes variants ranging from 3M to 304M parameters and is released under the Apache 2.0 license.

Summary of the leggedrobotics/defm model card, 2026-10-29

What it is

Released byleggedrobotics
Released2026-01-20
VRAM1.2 GB for the weights

What it runs on

Memory and cards for defm (BF16)

1.2 GBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What leggedrobotics says about defm

Read the model card


DeFM (Depth Foundation Model) is a vision backbone trained on 60M depth images via self-distillation. It is engineered for robotic perception, providing metric-aware representations that excel in sim-to-real transfer and cross-sensor generalization.

TL;DR - A DINO-style encoder, but for depth image inputs.

🌟 Key Features

  • Large-Scale Pretraining: We pretrain on our curated dataset of 60 M depth images using self-distillation.
  • Semantic Awareness: DeFM learns not only robust geometric priors but also semantically rich features from just depth images.
  • Metric-Aware Normalization: Our novel three channel input normalization preserves metric depth across multiple scales.
  • Compact efficient models: We distill our DeFM-ViT-L into a family of smaller efficient CNNs as small as 3M params for robot policy learning.
  • Robotics Proven: Our encoder is proven effective for diverse robotic tasks such as navigation, manipulation and locomotion without task-specific fine-tuning.

🚀 Usage

Install the package from PyPI:

pip install defm

Loading through TorchHub only needs torch torchvision numpy huggingface_hub omegaconf.

1. Loading the Model

Load via TorchHub for easy integration:

import torch

# Load the 304M-parameter foundation model
model = torch.hub.load('leggedrobotics/defm:main', 'defm_vit_l14', pretrained=True)
model.eval().to("cuda")

or, with the defm package installed:

from defm.model_factory import create_defm_model

model = create_defm_model("defm_vit_l14", pretrained=True)  # weights from the Hugging Face Hub

2. Preprocessing

DeFM requires depth maps to be processed into our metric-aware 3-channel format.

from defm import preprocess_depth_image

# Depth in meters: (H, W) numpy array, tensor or PIL image. target_size is an int (square) or (H, W).
normalized_depth = preprocess_depth_image(metric_depth, target_size=518, patch_size=14).to("cuda")

3. Inference

with torch.no_grad():
    output = model.get_intermediate_layers(
        normalized_depth, n=1, reshape=True, return_class_token=True)

spatial_tokens = output[0][0] # (B, C, H', W')
class_token = output[0][1] # (B, C)

The CNN models (defm_resnet50, defm_efficientnet_b0, ...) return a dict instead, and their input height and width must be multiples of 32:

model = torch.hub.load('leggedrobotics/defm:main', 'defm_resnet50', pretrained=True).eval().to("cuda")
normalized_depth = preprocess_depth_image(metric_depth, target_size=(224, 320)).to("cuda")

with torch.no_grad():
    output = model(normalized_depth)

class_token = output["global_backbone"]  # (B, C)
spatial_tokens = output["dense_bifpn"]["P4"]  # (B, C, H/16, W/16), the features distilled from the ViT

For more details, visit our GitHub repository.

📊 Model Zoo

The following table provides a comprehensive overview of the DeFM model family, including architectural parameters, inference latency across training and deployment hardware (224x224), and performance on the ImageNet-1k-Depth benchmark.

ModelParams (M)RTX 4090 BS-128 (ms)Jetson Orin (ms)Top-5 KNN (%)Linear Prob (%)Checkpoint
DeFM ViT-L/14303.7624.9172.8285.4272.76Download
DeFM ViT-S/1421.663.7611.9279.3762.74Download
DeFM ResNet-5026.269.3917.7978.9362.56Download
DeFM ResNet-3423.333.0813.5473.8454.78Download
DeFM ResNet-1811.721.068.6770.9351.57Download
DeFM EfficientNet-B628.98150.9854.1179.3060.70Download
DeFM EfficientNet-B414.1686.5139.6776.4556.24Download
DeFM EfficientNet-B24.9546.1228.3772.8951.64Download
DeFM EfficientNet-B03.0129.3921.0469.5447.17Download
DeFM RegNetY-1.6GF12.444.2541.8277.9658.88Download
DeFM RegNetY-800MF6.325.2124.1676.4358.62Download
DeFM RegNetY-400MF4.117.2725.1774.4351.80Download

📏 Benchmarks

benchmarks/ reproduces the linear-probe evaluations of the paper for DeFM and all image baselines (DINOv2, DINOv3, Depth Anything V2, C-RADIOv3, Theia), loading every model from its official Hugging Face weights:

git clone https://github.com/leggedrobotics/defm && cd defm
pip install -e ".[benchmarks]"
python -m benchmarks.segmentation --encoder defm_vit_l14 --dataset tartanground   # ScanNet, SUN RGB-D, OFFSED, TartanGround, GraspNet
python -m benchmarks.classification --encoder defm_vit_s14 --eval knn linear     # ImageNet

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms