Complete Codebase
Code for loading PulmoFoundation can be found in https://github.com/dddavid4real/PulmoFoundation.
Download Model Checkpoint
Download PulmoFoundation-E2.pth from Files and versions to models/ckpts/
Basic Usage
from models import get_model, get_transform
from PIL import Image
# Load model and preprocessing pipeline
model = get_model('cuda', 'models/ckpts/PulmoFoundation-E2.pth')
transform = get_transform()
# Load and preprocess image
img = Image.open('path/to/your/image.jpg') # Prefer 512x512 patches at 40X
img_tensor = transform(img)
img_tensor = img_tensor.unsqueeze(0) # Add batch dimension [1, 3, H, W]
img_tensor = img_tensor.cuda() # Move to GPU
# Extract features
features = model(img_tensor) # Shape: [1, 2560]
print(f"Feature shape: {features.shape}")
print(f"Feature vector: {features}")
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support
Model tree for david4real/PulmoFoundation
Base model
paige-ai/Virchow2