Downloads · 30 days
0
surajpaib/CT-FM-SegResNet
CT-FM-SegResNet is a machine learning model from surajpaib. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Instructions to load the pre-trained model weights
Downloads · 30 days
0
Access
Public
Updated Sep 12, 2024
Repo size
311 MB
Likes
1
Public
Click a slice to open those files.
.torch311 MB · 100%
From the Hugging Face model README
Instructions to load the pre-trained model weights
import torch
from monai.networks.nets import SegResNetDS
weights = torch.load("pretrained_segresnet.torch")
model = SegResNetDS(
blocks_down=(1, 2, 2, 4, 4)
)
model.load_state_dict(weights, strict=False) # Set strict to False as we load only the encoder
# Dummy forward pass
tensor = torch.randn((2, 1, 32, 32, 32))
# Note that the input data needs to be in "SPL" format (OR z,y,x default numpy/torch format),
# you can use Orientation transform in MONAI set with value "SPL".
# Note: All subsequent transforms must be applied in (z,y,x) format. Eg patch size of [16, 32, 32] corresponds to 16 in z-axis
out = model(tensor)