josand commited on
Commit
0b4d1b6
·
verified ·
1 Parent(s): 1134220

Clean model card formatting and usage

Browse files
Files changed (1) hide show
  1. README.md +85 -42
README.md CHANGED
@@ -2,77 +2,120 @@
2
  license: other
3
  library_name: mlx
4
  tags:
5
- - medical-imaging
 
6
  - apple-silicon
 
 
 
 
7
  - research
8
  language:
9
  - en
10
  license_name: nvidia-open-model
11
- license_link: LICENSE
 
 
12
  ---
13
- # NV-Segment-CT (VISTA-3D) automatic segment_all, weights afb51518
14
 
15
- Native MLX package: [nv-segment-ct-mlx](https://github.com/MedMLX/MLX-Segment-Ct.git).
16
- Evaluated revision: `d8969d90a299b0aebf62fce3a9afbf204734995b`.
17
 
18
- This card describes the one configuration evaluated in the MedMLX paper. It is research software; the single-case comparison does not estimate clinical accuracy.
 
19
 
20
- ## Source and checkpoint
 
 
21
 
22
- Original publisher: NVIDIA.
23
- Original implementation: [https://github.com/NVIDIA-Medtech/NV-Segment-CTMR](https://github.com/NVIDIA-Medtech/NV-Segment-CTMR).
24
- Source revision or version: `f9f5f51b589e5dc9c23c453cf5138398e4084056`.
25
- Original checkpoint: https://huggingface.co/nvidia/NV-Segment-CT/resolve/afb51518689f71e6abb367ee6301b2cd0225c66a/vista3d_pretrained_model/model.pt
 
 
26
 
27
- Conversion: README recipe: mlx_weights.convert_weights / mlx_correction_weights.convert_weights.
28
- Conversion changes tensor layout or storage as specified by the native package; it does not retrain the model.
29
 
30
- ## Recorded example
31
 
32
- AMOS22 (validation) / amos_0008
 
 
 
 
 
 
 
 
 
33
 
34
  ```python
35
- from nv_segment_ct_mlx.medmlx import run
36
-
37
- # Replace file and directory names with your locally obtained inputs and weights.
38
- kwargs = {
39
- "image_path": "image.nii.gz",
40
- "weights_path": "vista3d",
41
- "output_dir": "out",
42
- "segment_all": True,
43
- "overwrite": True
44
- }
45
- result = run(**kwargs)
46
  print(result["outputs"])
47
  ```
48
 
 
 
 
 
 
 
 
 
 
 
49
  Native result: **success**. Original-code comparison: **pass**, `minimum per-label mask Dice` = `1.0`.
50
 
51
  The demonstrated VISTA3D configuration uses NVIDIA NV-Segment-CT weights. Preserve that download origin; legacy MONAI weights have different terms.
52
 
53
- The complete [native run](native-run.json) and [original-code comparison](reference-comparison.json) retain commands, geometry, precision, and output-specific checks. Use the [replay harness](https://github.com/MedMLX/Med-MLX/blob/main/benchmarks/README.md) to substitute local paths. The package README documents installation and conversion.
 
 
 
 
 
 
54
 
55
- ## Distribution terms
56
 
57
- Upstream code: **Apache-2.0**. Weights: **LicenseRef-NVIDIA-Open-Model**.
58
- Converted weights are hosted in this repository.
59
 
60
- The demonstrated VISTA3D configuration uses NVIDIA NV-Segment-CT weights. Preserve that download origin; legacy MONAI weights have different terms. Converted weights may retain the identified upstream license and required notices; the accompanying notices describe the redistribution terms.
61
 
62
- Full [upstream license](LICENSE) accompanies any weight distribution.
 
 
 
63
 
64
- Required notices:
 
65
 
66
- - Retain the applicable license, copyright and attribution notices; identify the upstream checkpoint, authors, and MLX conversion changes.
67
- - Include the applicable NVIDIA Open Model Agreement and a Notice file containing: Licensed by NVIDIA Corporation under the NVIDIA Open Model License
68
 
69
- Review sources:
70
 
71
- - https://github.com/NVIDIA-Medtech/NV-Segment-CTMR
72
- - https://huggingface.co/nvidia/NV-Segment-CT/resolve/afb51518689f71e6abb367ee6301b2cd0225c66a/vista3d_pretrained_model/model.pt
73
- - https://huggingface.co/nvidia/NV-Segment-CT/blob/afb51518689f71e6abb367ee6301b2cd0225c66a/LICENSE
74
 
75
- ## Packaged files
 
76
 
77
- - `automatic.safetensors`
78
- - `correction.safetensors`
 
 
 
 
 
 
 
 
 
 
2
  license: other
3
  library_name: mlx
4
  tags:
5
+ - mlx
6
+ - native-mlx
7
  - apple-silicon
8
+ - medical-imaging
9
+ - ct
10
+ - segmentation
11
+ - vista3d
12
  - research
13
  language:
14
  - en
15
  license_name: nvidia-open-model
16
+ license_link: https://huggingface.co/MedMLX/vista3d-ct-mlx/blob/main/LICENSE
17
+ inference: false
18
+ pipeline_tag: image-segmentation
19
  ---
 
20
 
21
+ # VISTA-3D CT Segmentation
 
22
 
23
+ Native MLX port of [NVIDIA NV-Segment-CT (VISTA-3D)](https://github.com/NVIDIA-Medtech/NV-Segment-CTMR).
24
+ Run automatic 3D CT segmentation locally on Apple Silicon.
25
 
26
+ - Automatic whole-volume segmentation with the NVIDIA checkpoint
27
+ - Native MLX inference on Metal
28
+ - Converted automatic and correction weights included
29
 
30
+ MLX implementation by [MedMLX](https://github.com/MedMLX).
31
+ [GitHub](https://github.com/MedMLX/mlx-segment-ct) · [Usage](https://github.com/MedMLX/mlx-segment-ct#quick-start) · [Upstream](https://github.com/NVIDIA-Medtech/NV-Segment-CTMR)
32
+
33
+ **Requires the companion `mlx-segment-ct` runtime.** Follow the quick start below.
34
+
35
+ ## Requirements
36
 
37
+ Apple Silicon Mac with Metal GPU access, Python 3.12 and [uv](https://docs.astral.sh/uv/).
38
+ The weights are included here; checkpoint conversion is not needed.
39
 
40
+ ## Quick start
41
 
42
+ ```bash
43
+ uv venv --python 3.12
44
+ source .venv/bin/activate
45
+ uv pip install "mlx-segment-ct @ git+https://github.com/MedMLX/mlx-segment-ct.git" huggingface_hub
46
+
47
+ hf download MedMLX/vista3d-ct-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 mlx_segment_ct.medmlx import run
55
+
56
+ result = run(
57
+ image_path='ct.nii.gz',
58
+ weights_path='models',
59
+ output_dir='outputs',
60
+ segment_all=True,
61
+ )
 
 
 
62
  print(result["outputs"])
63
  ```
64
 
65
+ ## Input and output
66
+
67
+ Input is one 3D CT in NIfTI format (`.nii` or `.nii.gz`), in Hounsfield units.
68
+ The quick start uses automatic `segment_all` inference.
69
+
70
+ Output is `nv_segment_ct_mask.nii.gz` on the input grid, using the upstream
71
+ 0–254 label vocabulary; 255 means not covered.
72
+
73
+ ## Technical details
74
+
75
  Native result: **success**. Original-code comparison: **pass**, `minimum per-label mask Dice` = `1.0`.
76
 
77
  The demonstrated VISTA3D configuration uses NVIDIA NV-Segment-CT weights. Preserve that download origin; legacy MONAI weights have different terms.
78
 
79
+ These are recorded results for one configuration, not a new benchmark or an
80
+ estimate of clinical accuracy. The [native run](https://huggingface.co/MedMLX/vista3d-ct-mlx/blob/main/native-run.json)
81
+ and [original-code comparison](https://huggingface.co/MedMLX/vista3d-ct-mlx/blob/main/reference-comparison.json)
82
+ retain the commands, precision, geometry and output checks.
83
+
84
+ <details>
85
+ <summary>Checkpoint provenance and recorded configuration</summary>
86
 
87
+ Recorded configuration: **NV-Segment-CT (VISTA-3D) automatic segment_all, weights afb51518**.
88
 
89
+ Evaluated package revision: `d8969d90a299b0aebf62fce3a9afbf204734995b`.
 
90
 
91
+ Recorded input: AMOS22 (validation) / amos_0008.
92
 
93
+ Original publisher: NVIDIA.
94
+ Original implementation: [upstream source](https://github.com/NVIDIA-Medtech/NV-Segment-CTMR).
95
+ Source revision or version: `f9f5f51b589e5dc9c23c453cf5138398e4084056`.
96
+ Original checkpoint: [pinned checkpoint](https://huggingface.co/nvidia/NV-Segment-CT/resolve/afb51518689f71e6abb367ee6301b2cd0225c66a/vista3d_pretrained_model/model.pt).
97
 
98
+ Weights were converted with the companion MLX package, without retraining.
99
+ Conversion changes tensor layout or storage as required by that implementation.
100
 
101
+ The [replay harness](https://github.com/MedMLX/Med-MLX/blob/main/benchmarks/README.md)
102
+ describes how to reproduce the recorded configuration with local paths.
103
 
104
+ </details>
105
 
106
+ ## Intended use
 
 
107
 
108
+ Research and education. Outputs require human review and are not intended for
109
+ clinical diagnosis or treatment decisions.
110
 
111
+ ## License
112
+
113
+ Weights: **LicenseRef-NVIDIA-Open-Model** ([license](https://huggingface.co/MedMLX/vista3d-ct-mlx/blob/main/LICENSE)).
114
+ Upstream code: **Apache-2.0**. MLX port code:
115
+ [Apache-2.0](https://github.com/MedMLX/mlx-segment-ct/blob/main/LICENSE).
116
+
117
+ Retain the [attribution and notices](https://huggingface.co/MedMLX/vista3d-ct-mlx/blob/main/NOTICE) when redistributing
118
+ the bundle or a conversion:
119
+
120
+ - Retain the applicable license, copyright and attribution notices; identify the upstream checkpoint, authors, and MLX conversion changes.
121
+ - Include the applicable NVIDIA Open Model Agreement and a Notice file containing: Licensed by NVIDIA Corporation under the NVIDIA Open Model License