Skip to main content
For academic users, H-Optimus-1 weights are available directly on Hugging Face and can be loaded with timm — no server or AWS account required.
Non-commercial academic use only. H-Optimus-1 on Hugging Face is released under CC-BY-NC-ND 4.0. Commercial use, sale, or monetization (including models trained on its outputs) is prohibited without prior approval. For commercial use, deploy via AWS or on-premise, or contact Bioptimus.

1. Request access

Access is gated. On huggingface.co/bioptimus/H-optimus-1, accept the terms using your institutional email (it must match your Hugging Face account email to be approved).

2. Load the model and extract features

H-Optimus-1 expects 224×224 images extracted at 0.5 microns per pixel.
from huggingface_hub import login
import torch
import timm
from torchvision import transforms

login()  # token from https://huggingface.co/settings/tokens

model = timm.create_model(
    "hf-hub:bioptimus/H-optimus-1",
    pretrained=True, init_values=1e-5, dynamic_img_size=False,
)
model.to("cuda").eval()

transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize(
        mean=(0.707223, 0.578729, 0.703617),
        std=(0.211883, 0.230117, 0.177517),
    ),
])

tile = transforms.ToPILImage()(torch.rand(3, 224, 224))

with torch.autocast(device_type="cuda", dtype=torch.float16):
    with torch.inference_mode():
        features = model(transform(tile).unsqueeze(0).to("cuda"))

assert features.shape == (1, 1536)
Mixed precision (autocast) is recommended for faster inference. The normalization constants above are specific to H-Optimus-1 — use them as shown.

When to use a different option

Need M-Optimus or commercial use?

M-Optimus and commercial licensing are available via AWS Marketplace.

Need whole-slide tooling?

The bioptimus SDK handles tiling and tissue masking against a deployed server.