ZepengHuo
commited on
Commit
·
90862ec
0
Parent(s):
Upload UNet-TTE model
Browse files- .gitattributes +1 -0
- README.md +31 -0
- config.json +6 -0
- unet_tte.pth +3 -0
.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ResNetV2-CT Checkpoint
|
2 |
+
|
3 |
+
This is a PyTorch Lightning `.ckpt` checkpoint for a SwinUNETR model trained on chest CT images with TTE objective.
|
4 |
+
|
5 |
+
## Usage
|
6 |
+
|
7 |
+
A quickstart script is below.
|
8 |
+
|
9 |
+
```python
|
10 |
+
import torch
|
11 |
+
from src.networks import SwinUNETRForClassification
|
12 |
+
swin_unetr_params = {
|
13 |
+
"img_size": (224, 224, 224),
|
14 |
+
"in_channels": 1,
|
15 |
+
"out_channels": 2,
|
16 |
+
"feature_size": 48,
|
17 |
+
"drop_rate": 0.0,
|
18 |
+
"attn_drop_rate": 0.0,
|
19 |
+
"dropout_path_rate": 0.0,
|
20 |
+
"use_checkpoint": True,
|
21 |
+
}
|
22 |
+
model = SwinUNETRForClassification(
|
23 |
+
swin_unetr_params=swin_unetr_params, num_classes=2
|
24 |
+
).to(device)
|
25 |
+
state_dict = torch.load(
|
26 |
+
loadmodel_path, map_location=f"cuda:{torch.cuda.current_device()}"
|
27 |
+
)
|
28 |
+
model.load_state_dict(state_dict)
|
29 |
+
```
|
30 |
+
|
31 |
+
For detailed instructions please follow the [README in Github repo](https://github.com/som-shahlab/tte-pretraining/tree/main?tab=readme-ov-file#evaluation).
|
config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"model_type": "model_3d",
|
3 |
+
"model_name": "swinunetr",
|
4 |
+
"pretrain_type": "time-to-event",
|
5 |
+
"num_class": 8192
|
6 |
+
}
|
unet_tte.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c7c45bdb2d5c60c04ad2bcefabbd34eec2a8911ed970c30c631d73ab9a566dd
|
3 |
+
size 302639525
|