|
{ |
|
"imports": [ |
|
"$import glob", |
|
"$import os" |
|
], |
|
"bundle_root": ".", |
|
"output_dir": "$@bundle_root + '/eval'", |
|
"dataset_dir": "$@bundle_root + '/dataset/images'", |
|
"datalist": "$list(sorted(glob.glob(@dataset_dir + '/*.nii.gz')))", |
|
"device": "$torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')", |
|
"network_def": { |
|
"_target_": "scripts.networks.unest_base_patch_4.UNesT", |
|
"in_channels": 1, |
|
"out_channels": 133, |
|
"patch_size": 4, |
|
"depths": [ |
|
2, |
|
2, |
|
8 |
|
], |
|
"embed_dim": [ |
|
128, |
|
256, |
|
512 |
|
], |
|
"num_heads": [ |
|
4, |
|
8, |
|
16 |
|
] |
|
}, |
|
"network": "$@network_def.to(@device)", |
|
"preprocessing": { |
|
"_target_": "Compose", |
|
"transforms": [ |
|
{ |
|
"_target_": "LoadImaged", |
|
"keys": "image" |
|
}, |
|
{ |
|
"_target_": "EnsureChannelFirstd", |
|
"keys": "image" |
|
}, |
|
{ |
|
"_target_": "NormalizeIntensityd", |
|
"keys": "image", |
|
"nonzero": "True", |
|
"channel_wise": "True" |
|
}, |
|
{ |
|
"_target_": "EnsureTyped", |
|
"keys": "image" |
|
} |
|
] |
|
}, |
|
"dataset": { |
|
"_target_": "Dataset", |
|
"data": "$[{'image': i} for i in @datalist]", |
|
"transform": "@preprocessing" |
|
}, |
|
"dataloader": { |
|
"_target_": "DataLoader", |
|
"dataset": "@dataset", |
|
"batch_size": 1, |
|
"shuffle": false, |
|
"num_workers": 4 |
|
}, |
|
"inferer": { |
|
"_target_": "SlidingWindowInferer", |
|
"roi_size": [ |
|
96, |
|
96, |
|
96 |
|
], |
|
"sw_batch_size": 4, |
|
"overlap": 0.7 |
|
}, |
|
"postprocessing": { |
|
"_target_": "Compose", |
|
"transforms": [ |
|
{ |
|
"_target_": "Activationsd", |
|
"keys": "pred", |
|
"softmax": true |
|
}, |
|
{ |
|
"_target_": "Invertd", |
|
"keys": "pred", |
|
"transform": "@preprocessing", |
|
"orig_keys": "image", |
|
"meta_key_postfix": "meta_dict", |
|
"nearest_interp": false, |
|
"to_tensor": true |
|
}, |
|
{ |
|
"_target_": "AsDiscreted", |
|
"keys": "pred", |
|
"argmax": true |
|
}, |
|
{ |
|
"_target_": "SaveImaged", |
|
"keys": "pred", |
|
"meta_keys": "pred_meta_dict", |
|
"output_dir": "@output_dir" |
|
} |
|
] |
|
}, |
|
"handlers": [ |
|
{ |
|
"_target_": "CheckpointLoader", |
|
"load_path": "$@bundle_root + '/models/model.pt'", |
|
"load_dict": { |
|
"model": "@network" |
|
}, |
|
"strict": "True" |
|
}, |
|
{ |
|
"_target_": "StatsHandler", |
|
"iteration_log": false |
|
} |
|
], |
|
"evaluator": { |
|
"_target_": "SupervisedEvaluator", |
|
"device": "@device", |
|
"val_data_loader": "@dataloader", |
|
"network": "@network", |
|
"inferer": "@inferer", |
|
"postprocessing": "@postprocessing", |
|
"val_handlers": "@handlers", |
|
"amp": false |
|
}, |
|
"evaluating": [ |
|
"$setattr(torch.backends.cudnn, 'benchmark', True)", |
|
"[email protected]()" |
|
] |
|
} |
|
|