josand commited on
Commit
3665959
·
verified ·
1 Parent(s): 0d64ced

Simplify model card with concise usage and MedMLX branding

Browse files
Files changed (3) hide show
  1. README.md +17 -75
  2. banner.png +0 -0
  3. banner.svg +1 -0
README.md CHANGED
@@ -17,38 +17,35 @@ pipeline_tag: image-segmentation
17
  base_model: MONAI/brats_mri_segmentation
18
  ---
19
 
20
- # SegResNet Brain Tumor Segmentation
21
 
22
- Native MLX port of [MONAI BraTS MRI segmentation](https://huggingface.co/MONAI/brats_mri_segmentation).
23
- Segment brain tumor regions from four MRI sequences locally on Apple Silicon.
24
 
25
- - T1, contrast-enhanced T1, T2 and FLAIR inputs
26
- - Native whole-volume segmentation with MLX
27
- - Converted MONAI SegResNet checkpoint included
28
 
29
- MLX implementation by [MedMLX](https://github.com/MedMLX).
30
- [GitHub](https://github.com/MedMLX/segresnet-mlx) · [Usage](https://github.com/MedMLX/segresnet-mlx#quick-start) · [Upstream](https://huggingface.co/MONAI/brats_mri_segmentation)
31
 
32
- **Requires the companion `segresnet-mlx` runtime.** Follow the quick start below.
 
 
33
 
34
- ## Requirements
35
-
36
- Apple Silicon Mac with Metal GPU access, Python 3.13 or 3.14 and [uv](https://docs.astral.sh/uv/).
37
- The weights are included here; checkpoint conversion is not needed.
38
 
39
  ## Quick start
40
 
41
  ```bash
42
  uv venv --python 3.13
43
  source .venv/bin/activate
44
- uv pip install "segresnet-mlx @ https://github.com/MedMLX/segresnet-mlx/releases/download/v0.2.1/segresnet_mlx-0.2.1-py3-none-any.whl"
 
 
 
45
  uv tool install huggingface-hub
46
 
47
  hf download MedMLX/segresnet-brats-mlx --local-dir models
48
  ```
49
 
50
- Authenticate with `hf auth login` if repository access is required.
51
- Run this example in the same environment, replacing the input paths with your own:
52
 
53
  ```python
54
  from segresnet_mlx.medmlx import run
@@ -65,65 +62,10 @@ result = run(
65
  print(result["outputs"])
66
  ```
67
 
68
- ## Input and output
69
-
70
- Input is four 3D NIfTI MRI volumes on the same voxel grid: T1,
71
- contrast-enhanced T1, T2 and FLAIR. The example names each modality explicitly.
72
-
73
- Output is `brats_mri_segmentation_mask.nii.gz` on the input grid. Exported
74
- labels use the bundle’s BraTS convention: 0 background, 1 tumor core,
75
- 2 whole tumor outside the core, 4 enhancing tumor.
76
-
77
- ## Technical details
78
-
79
- The companion runtime is [v0.2.1](https://github.com/MedMLX/segresnet-mlx/releases/tag/v0.2.1), source `b5cc265cd0426fe8f64b40a8ed9be4c42a599724`, with `medmlx-core==0.2.3`. All 83 tensors here exactly match a fresh CPU host conversion of the pinned BraTS source checkpoint through that installed release's public `convert_state_dict` API. The weights were retained unchanged.
80
-
81
- The current fresh-wheel suite passed 145 tests with zero skips: 133 ordinary cases and 12 released **renal** checkpoint cases. Those renal results do not qualify this BraTS checkpoint. The full-volume BraTS comparison below is historical and retains its original software revision and one-case scope; no new full-volume BraTS or clinical performance claim is made.
82
-
83
- Historical native result: **success**. Original-code comparison: **pass**, `minimum_per_label_dice` = `1.0`.
84
-
85
- Native whole-volume output compared with the original MONAI bundle; the October 12 renal operator repair also has a full-case BraTS regression.
86
-
87
- These are recorded results for one configuration, not a new benchmark or an
88
- estimate of clinical accuracy. The [native run](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/native-run.json)
89
- and [original-code comparison](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/reference-comparison.json)
90
- retain the commands, precision, geometry and output checks.
91
-
92
- <details>
93
- <summary>Checkpoint provenance and recorded configuration</summary>
94
-
95
- Recorded configuration: **MONAI brats_mri_segmentation (SegResNet, 4-channel MRI)**.
96
-
97
- Evaluated package revision: `40cbce54523632fbc8cdfc564a9cce48d8df3424`.
98
-
99
- Recorded input: MSD Task01 BrainTumour (training) / BRATS_001.
100
-
101
- Original publisher: MONAI.
102
- Original implementation: [upstream source](https://huggingface.co/MONAI/brats_mri_segmentation).
103
- Source revision or version: `370f7f9d062745fbac445e7fe6d6616d35df04ec`.
104
- Original checkpoint: [pinned checkpoint](https://huggingface.co/MONAI/brats_mri_segmentation/resolve/370f7f9d062745fbac445e7fe6d6616d35df04ec/models/model.pt).
105
-
106
- Weights were converted with the companion MLX package, without retraining.
107
- Conversion changes tensor layout or storage as required by that implementation.
108
-
109
- The [replay harness](https://github.com/MedMLX/Med-MLX/blob/main/benchmarks/README.md)
110
- describes how to reproduce the recorded configuration with local paths.
111
-
112
- </details>
113
-
114
- ## Intended use
115
-
116
- Research and education. Outputs require human review and are not intended for
117
- clinical diagnosis or treatment decisions.
118
-
119
- ## License
120
 
121
- Weights: **Apache-2.0** ([license](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/LICENSE)).
122
- Upstream code: **Apache-2.0**. MLX port code:
123
- [Apache-2.0](https://github.com/MedMLX/segresnet-mlx/blob/main/LICENSE).
124
 
125
- Retain the [attribution and notices](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/NOTICE) when redistributing
126
- the bundle or a conversion:
127
 
128
- - Retain the applicable license, copyright and attribution notices; identify the upstream checkpoint, authors, and MLX conversion changes.
129
- - Include Apache-2.0, retain applicable upstream NOTICE content, and mark modifications.
 
17
  base_model: MONAI/brats_mri_segmentation
18
  ---
19
 
20
+ <img src="https://huggingface.co/MedMLX/segresnet-brats-mlx/resolve/main/banner.png" alt="MedMLX — Segment. BRAIN MRI / SEGRESNET" width="100%">
21
 
22
+ # SegResNet · Brain Tumor
 
23
 
24
+ Segment brain tumor regions from four MRI sequences with the MONAI SegResNet checkpoint.
 
 
25
 
26
+ [GitHub](https://github.com/MedMLX/segresnet-mlx) · [Files](https://huggingface.co/MedMLX/segresnet-brats-mlx/tree/main) · [Docs](https://github.com/MedMLX/segresnet-mlx/blob/main/README.md#quick-start)
 
27
 
28
+ | Input | Output |
29
+ | :--- | :--- |
30
+ | T1, T1ce, T2 + FLAIR · NIfTI | Brain tumor segmentation |
31
 
32
+ **Apple Silicon · Metal · Python 3.13 / 3.14**
 
 
 
33
 
34
  ## Quick start
35
 
36
  ```bash
37
  uv venv --python 3.13
38
  source .venv/bin/activate
39
+
40
+ repo="https://github.com/MedMLX/segresnet-mlx"
41
+ release="$repo/releases/download/v0.2.1"
42
+ uv pip install "$release/segresnet_mlx-0.2.1-py3-none-any.whl"
43
  uv tool install huggingface-hub
44
 
45
  hf download MedMLX/segresnet-brats-mlx --local-dir models
46
  ```
47
 
48
+ Replace the example input paths with your own files.
 
49
 
50
  ```python
51
  from segresnet_mlx.medmlx import run
 
62
  print(result["outputs"])
63
  ```
64
 
65
+ All four MRI volumes must share the same voxel grid.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ ## Use & license
 
 
68
 
69
+ For research and education. Not validated for clinical use.
 
70
 
71
+ Weights: [Apache-2.0](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/LICENSE). [Notices](https://huggingface.co/MedMLX/segresnet-brats-mlx/blob/main/NOTICE).
 
banner.png ADDED
banner.svg ADDED