Views
No views yet
1import torch
2from synthstroke_model import SynthStrokeModel
3
4# Load the model from Hugging Face Hub
5model = SynthStrokeModel.from_pretrained("liamchalcroft/synthstroke-baseline")
6
7# Prepare your input (example shape: batch_size=1, channels=1, H, W, D)
8input_tensor = torch.randn(1, 1, 192, 192, 192)
9
10# Get predictions (with optional TTA for improved accuracy)
11predictions = model.predict_segmentation(input_tensor, use_tta=True)
12
13# Get lesion probability map (channel 1)
14lesion_probs = predictions[:, 1] # Shape: (batch_size, H, W, D)
15
16# Alternative: Get logits without TTA
17logits = model.predict_segmentation(input_tensor, apply_softmax=False)1@article{chalcroft2025synthetic,
2 title={Synthetic Data for Robust Stroke Segmentation},
3 author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
4 journal={Machine Learning for Biomedical Imaging},
5 volume={3},
6 pages={317--346},
7 year={2025},
8 publisher={Machine Learning for Biomedical Imaging},
9 doi={10.59275/j.melba.2025-f3g6},
10 url={https://www.melba-journal.org/papers/2025:014.html}
11}1@article{Chalcroft_2025,
2 title={Synthetic Data for Robust Stroke Segmentation},
3 volume={3},
4 ISSN={2766-905X},
5 url={http://dx.doi.org/10.59275/j.melba.2025-f3g6},
6 DOI={10.59275/j.melba.2025-f3g6},
7 number={August 2025},
8 journal={Machine Learning for Biomedical Imaging},
9 publisher={Machine Learning for Biomedical Imaging},
10 author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
11 year={2025},
12 month=aug, pages={317–346}
13}