Model Zoo¶
This page provides download links to the pre-trained MicroStructFormer models hosted on Hugging Face.
Downloading Models¶
To ensure reproducibility and simplify the setup process, we provide a Python script that automatically downloads the optimal curated weights from our clean release repository on Hugging Face (View Model Card).
1. Download the script¶
First, save the following script to your local machine: - Download download_model.py
(Ensure that you have installed huggingface_hub in your Python environment: pip install huggingface_hub)
2. List available models¶
Open your terminal and run:
python download_model.py --list
Available models:
- MicroStructFormer_Swin_Large
3. Download a specific model¶
Run the following command to download the weights. By default, it will create a folder with the model's name in your current directory.
python download_model.py -m MicroStructFormer_Swin_Large
-d flag:
python download_model.py -m MicroStructFormer_Swin_Large -d /path/to/save/weights
Once downloaded, you can point your MODEL_DIR variable to this folder in the inference code.
Semantic-to-fiber instance conversion¶
To convert semantic segmentation results into instance-level metrics, download our reference implementation:
The script includes complete logic and visualization functions to display results for all four compartments (axon, myelin, PAS, abnormality).
License¶
The pre-trained weights are provided under the CC-BY-NC-SA 4.0 License.