Views
No views yet
@article{chen2019med3d,
title={Med3D: Transfer Learning for 3D Medical Image Analysis},
author={Chen, Sihong and Ma, Kai and Zheng, Yefeng},
journal={arXiv preprint arXiv:1904.00625},
year={2019}
}1from transformers import AutoConfig, AutoModelForImageClassification
2import torch
3
4config = AutoConfig.from_pretrained(
5 'nwirandx/medicalnet-resnet3d101',
6 trust_remote_code=True
7)
8
9# use a model from scratch
10# model = AutoModelForImageClassification.from_config(
11# config,
12# trust_remote_code=True
13# )
14
15# use pretrained model
16model = AutoModelForImageClassification.from_pretrained(
17 'nwirandx/medicalnet-resnet3d101',
18 trust_remote_code=True
19)
20
21x = torch.randn(1, 1, 64, 64, 64) # Example 3D volume
22outputs = model(x)