MetPredict Lung Structure Segmentation
Pathology segmentation for lung structures (blood vessels and airways). Encoder (freezed): H-optimus-0 ViT backbone (pretrained on histopathology data). Decoder (trained): custom DPT head with multi-scale feature fusion.
Fonte do modelo
- Tipo
- Other
- Tamanho do arquivo
- 4,42 GB
- Versão
- vRevision e72f0d1
- Atualizado
- 1 de nov. de 2026
- Downloads
- 7
- Fonte
- Hugging Face
Descrição da fonte
Lung structures Segmentation (DPT)
Pathology segmentation for lung structures (blood vessels and airways).
- Encoder (freezed): H-optimus-0 ViT backbone (pretrained on histopathology data).
- Decoder (trained): custom DPT head with multi-scale feature fusion.
Usage
The model expects a normalized (B, 3, H, W) float tensor as pixel_values.
Use ImageNet mean/std — same stats applied at training time (matches the
H-optimus-0 backbone's expected input distribution).
Input image: 224x224 @ 1.5 MPP
import numpy as np
import torch
from PIL import Image
from torchvision.transforms import ToTensor, Normalize, Resize, Compose
from transformers import AutoModel
model = AutoModel.from_pretrained("RendeiroLab/MetPredict-lung-structure-segmentation", trust_remote_code=True).eval()
device = next(model.parameters()).device
transform = Compose([
ToTensor(),
Resize((224, 224)),
Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]
),
])
img = Image.open("tile.png").convert("RGB")
x = transform(img)
pixel_values = x.unsqueeze(0).to(device)
with torch.inference_mode():
out = model(pixel_values)
logits = out.logits # (1, n_classes, H, W)
pred = logits.argmax(dim=1) # (1, H, W)
Fontes
1 fonte
Fontes
1 fonteVerificado 1 de nov.
Download files
Artefatos de modelo
1 artefato
Artefatos de modelo
1 artefatoTrechos de fonte
3 trechos
Trechos de fonte
3 trechos--- library_name: transformers tags: - image-segmentation - pathology - dpt pipeline_tag: image-segmentation --- # Lung structures Segmentation (DPT) Pathology segmentation for lung structures (blood vessels and airways). - Encoder (freezed): H-optimus-0 ViT backbone (pretrained on histopathology data). - Decoder (trained): custom DPT head with multi-scale feature fusion. ## Usage The model expects a normalized `(B, 3, H, W)` float tensor as `pixel_values`. Use ImageNet mean/std — same stats applied at training time (matches the H-optimus-0 backbone's expected input distribution). Input image: 224x224 @ 1.5 MPP ```python import numpy as np import torch from PIL import Image from torchvision.transforms import ToTensor, Normalize, Resize, Compose from transformers import AutoModel model = AutoModel.from_pretrained("RendeiroLab/MetPredict-lung-structure-segmentation", trust_remote_code=True).eval() device = next(model.parameters()).device transform = Compose([ ToTensor(), Resize((224, 224)), Normalize( mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225] ), ]) img = Image.open("tile.png").convert("RGB") x = transform(img) pixel_values = x.unsqueeze(0).to(device) with torch.inference_mode(): out = model(pixel_values) logits = out.logits # (1, n_classes, H, W) pred = logits.argmax(dim=1) # (1, H, W) ```
Source context: 7 downloads · 0 likes · Pipeline image-segmentation · Library transformers · Repo RendeiroLab/MetPredict-lung-structure-segmentation
Source context: 4 downloads · 0 likes · Pipeline image-segmentation · Library transformers · Repo RendeiroLab/MetPredict-lung-structure-segmentation
