Skip to content

Commit 70c0443

Browse files
authored
5090 5161 minor doc/env fixes (#5162)
Fixes #5161 part of #5090 ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]>
1 parent ca90628 commit 70c0443

File tree

10 files changed

+43
-37
lines changed

10 files changed

+43
-37
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sphinxcontrib-serializinghtml
2020
sphinx-autodoc-typehints==1.11.1
2121
pandas
2222
einops
23-
transformers
23+
transformers<4.22 # https://github.com/Project-MONAI/MONAI/issues/5157
2424
mlflow
2525
tensorboardX
2626
imagecodecs; platform_system == "Linux"

docs/source/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Its ambitions are:
2323
Features
2424
--------
2525

26-
*The codebase is currently under active development*
27-
2826
- flexible pre-processing for multi-dimensional medical imaging data;
2927
- compositional & portable APIs for ease of integration in existing workflows;
3028
- domain-specific implementations for networks, losses, evaluation metrics and more;
@@ -72,6 +70,13 @@ Technical documentation is available at `docs.monai.io <https://docs.monai.io>`_
7270

7371
bundle_intro
7472

73+
Model Zoo
74+
---------
75+
76+
`The MONAI Model Zoo <https://github.com/Project-MONAI/model-zoo>`_ is a place for researchers and data scientists to share the latest and great models from the community.
77+
Utilizing `the MONAI Bundle format <https://docs.monai.io/en/latest/bundle_intro.html>`_ makes it easy to get started building workflows with MONAI.
78+
79+
7580
Links
7681
-----
7782

docs/source/modules.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ are handled with specific protocols, and the data arrays are often high-dimensio
3030
[`monai.data`](https://github.com/Project-MONAI/MONAI/tree/dev/monai/data) modules include a set of domain-specific APIs
3131
for various deep learning applications:
3232

33-
### Transforms with data in 'array' and 'dictionary' styles
33+
### Transforms with data in array and dictionary styles
3434

3535
![3d transform examples](../images/affine.png)
3636

@@ -83,7 +83,7 @@ domain-specific usability and pipeline performance.
8383
### Cache IO and transforms data to accelerate training
8484

8585
Data-driven methods require many (potentially thousands of) epochs of training data reading and preprocessing. MONAI
86-
provides multi-threaded cache-based datasets to accelerate the process. [[Datasets experiment]](https://github.com/Project-MONAI/tutorials/blob/master/acceleration/dataset_type_performance.ipynb). The
86+
provides multi-threaded cache-based datasets to accelerate the process [[Datasets experiment]](https://github.com/Project-MONAI/tutorials/blob/master/acceleration/dataset_type_performance.ipynb). The
8787
cache can be persistent and dynamic (`SmartCacheDataset`) and reused across different experiments [[SmartCache example]](https://github.com/Project-MONAI/tutorials/blob/master/acceleration/distributed_training/unet_training_smartcache.py).
8888
The following figure illustrates the training speedup compared with a regular PyTorch program.
8989

@@ -102,7 +102,7 @@ a `ThreadDataLoader` example is within the [Spleen fast training tutorial](https
102102
### Public datasets
103103

104104
To quickly get started with popular training data, MONAI provides several ready-to-integrate Dataset classes
105-
(such as `MedNISTDataset`, `DecathlonDataset`), which include data downloading, and support training/evaluation splits generation with transforms.
105+
(such as `MedNISTDataset`, `DecathlonDataset`, [`TciaDataset`](https://github.com/Project-MONAI/tutorials/blob/main/modules/tcia_dataset.ipynb)), which include data downloading, and support training/evaluation splits generation with transforms.
106106
[[Public datasets tutorial]](https://github.com/Project-MONAI/tutorials/blob/master/modules/public_datasets.ipynb)
107107
The common workflow of predefined datasets:
108108

@@ -231,8 +231,8 @@ A typical process of `decollate batch` is illustrated as follows (with a `batch_
231231

232232
Except for the pytorch-ignite based `monai.engines`, most of the MONAI modules could be used independently or combined
233233
with other software packages. For example, MONAI can be easily integrated into popular frameworks such as
234-
PyTorch-Lightning and Catalyst: [Lightning segmentation](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/spleen_segmentation_3d_lightning.ipynb),
235-
[Catalyst segmentation](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/unet_segmentation_3d_catalyst.ipynb).
234+
PyTorch-Lightning and Catalyst. [[Lightning segmentation](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/spleen_segmentation_3d_lightning.ipynb),
235+
[Catalyst segmentation](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/unet_segmentation_3d_catalyst.ipynb)]
236236

237237
## Bundle
238238

@@ -264,7 +264,7 @@ A typical bundle example can include:
264264
┗━ *license.txt
265265
```
266266
Details about the bundle config definition and syntax & examples are at [config syntax](https://docs.monai.io/en/latest/config_syntax.html).
267-
A step-by-step [get started](https://github.com/Project-MONAI/tutorials/blob/master/modules/bundles/get_started.ipynb) tutorial notebook can help users quickly set up a bundle. [[bundle examples]](https://github.com/Project-MONAI/tutorials/tree/main/modules/bundle)
267+
A step-by-step [get started](https://github.com/Project-MONAI/tutorials/blob/master/modules/bundles/get_started.ipynb) tutorial notebook can help users quickly set up a bundle. [[bundle examples](https://github.com/Project-MONAI/tutorials/tree/main/bundle), [model-zoo](https://github.com/Project-MONAI/model-zoo)]
268268

269269
## Federated Learning
270270

@@ -288,7 +288,7 @@ with [`ClientAlgo`](https://docs.monai.io/en/latest/fl.html#clientalgo) to allow
288288
It leverages the latest advances in MONAI
289289
and GPUs to efficiently develop and deploy algorithms with state-of-the-art performance.
290290
It first analyzes the global information such as intensity, dimensionality, and resolution of the dataset,
291-
then generates algorithms in MONAI bundle format based on data statistics and algorithm templates.
291+
then generates algorithms in MONAI bundle format based on data statistics and [algorithm templates](https://github.com/Project-MONAI/research-contributions/tree/main/auto3dseg).
292292
Next, all algorithms initiate model training to obtain checkpoints with the best validation performance.
293293
Finally, the ensemble module selects the algorithms via ranking trained checkpoints and creates ensemble predictions.
294294

docs/source/whatsnew_1_0.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For more details about how to use the models, please see [the tutorials](https:/
2121
It leverages the latest advances in MONAI
2222
and GPUs to efficiently develop and deploy algorithms with state-of-the-art performance.
2323
It first analyzes the global information such as intensity, dimensionality, and resolution of the dataset,
24-
then generates algorithms in MONAI bundle format based on data statistics and algorithm templates.
24+
then generates algorithms in MONAI bundle format based on data statistics and [algorithm templates](https://github.com/Project-MONAI/research-contributions/tree/main/auto3dseg).
2525
Next, all algorithms initiate model training to obtain checkpoints with the best validation performance.
2626
Finally, the ensemble module selects the algorithms via ranking trained checkpoints and creates ensemble predictions.
2727

@@ -42,15 +42,14 @@ collaborative learning in medical imaging.
4242
## MetaTensor Support for Digital Pathology Workflows
4343
![pathology](../images/pathology-meta.png)
4444

45-
MetaTensor is officially released in MONAI v0.9, which is a simple yet elegant way to handle metadata along with the image
46-
in the same object. In this release (v1.0), we support MetaTensor in all digital pathology components, and make sure that
47-
the future development can benefit from them. With the help of MONAI Pathology Working Group, we have standardized a
48-
set of metadata attributes for patches of images extracted from WSI to ensure reproducibility and enhance functionality
49-
via relying on a standard set of attributes. The figure below shows all the pathology metadata attributes,
50-
their definition, and their relation to MetaTensors. Using `LoadImage` transform with WSIReader will output a
51-
MetaTensor with populated metadata inferred from the data file. Currently, WSIReader loads the patches into the CPU memory
52-
but they can be transferred to GPU via appropriate transforms. We are working with the cuCIM team to make sure that we can
53-
bring direct loading of images into the GPU in the future releases.
45+
In this release, we support MetaTensor in all digital pathology components, and
46+
make sure that the future development can benefit from them. With the help of
47+
MONAI Pathology Working Group, we have standardized a set of metadata
48+
attributes for patches of images extracted from WSI to ensure reproducibility
49+
and enhance functionality via relying on a standard set of attributes. The
50+
figure above shows all the pathology metadata attributes and their relation to
51+
MetaTensors. Please see [the tutorials and
52+
examples](https://github.com/Project-MONAI/tutorials/tree/main/pathology).
5453

5554
## Accelerated MRI Reconstruction
5655
![MRI-reconstruction](../images/mri_recon.png)

environment-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies:
3838
- pandas
3939
- requests
4040
- einops
41-
- transformers
41+
- transformers<4.22 # https://github.com/Project-MONAI/MONAI/issues/5157
4242
- mlflow
4343
- tensorboardX
4444
- pyyaml
@@ -47,7 +47,6 @@ dependencies:
4747
- pynrrd
4848
- pydicom
4949
- h5py
50-
- nni
5150
- optuna
5251
- pip
5352
- pip:
@@ -65,3 +64,4 @@ dependencies:
6564
- imagecodecs; platform_system == "Linux"
6665
- tifffile; platform_system == "Linux"
6766
- matplotlib!=3.5.0
67+
- nni

monai/apps/auto3dseg/auto_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def set_prediction_params(self, params: Optional[Dict[str, Any]] = None):
381381
def set_hpo_params(self, params: Optional[Dict[str, Any]] = None):
382382
"""
383383
Set parameters for the HPO module and the algos before the training. It will attempt to (1) override bundle
384-
templates with the key-value pairs in ``params`` (2) chagne the config of the HPO module (e.g. NNI) if the
384+
templates with the key-value pairs in ``params`` (2) change the config of the HPO module (e.g. NNI) if the
385385
key is found to be one of:
386386
387387
- "trialCodeDirectory"
@@ -394,7 +394,7 @@ def set_hpo_params(self, params: Optional[Dict[str, Any]] = None):
394394
395395
Args:
396396
params: a dict that defines the overriding key-value pairs during instantiation of the algo. For
397-
BundleAlgo, it will overide the template config filling.
397+
BundleAlgo, it will override the template config filling.
398398
"""
399399
if params is None:
400400
self.hpo_params = self.train_params
@@ -406,7 +406,7 @@ def set_nni_search_space(self, search_space):
406406
Set the search space for NNI parameter search.
407407
408408
Args:
409-
search_space: hyper paramter search space in the form of dict. For more information, please check
409+
search_space: hyper parameter search space in the form of dict. For more information, please check
410410
NNI documentation: https://nni.readthedocs.io/en/v2.2/Tutorial/SearchSpaceSpec.html .
411411
"""
412412
value_combinations = 1
@@ -471,7 +471,7 @@ def set_ensemble_method(self, ensemble_method_name: str = "AlgoEnsembleBestN", *
471471

472472
def _train_algo_in_sequence(self, history: List[Dict[str, Any]]):
473473
"""
474-
Train the Algos in a seqential scheme. The order of training is randomized.
474+
Train the Algos in a sequential scheme. The order of training is randomized.
475475
476476
Args:
477477
history: the history of generated Algos. It is a list of dicts. Each element has the task name

monai/apps/auto3dseg/bundle_gen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, template_path: str):
7575

7676
def set_data_stats(self, data_stats_files: str): # type: ignore
7777
"""
78-
Set the data anlysis report (generated by DataAnalyzer).
78+
Set the data analysis report (generated by DataAnalyzer).
7979
8080
Args:
8181
data_stats_files: path to the datastats yaml file
@@ -253,8 +253,8 @@ def infer(self, image_file):
253253
def predict(self, predict_params=None):
254254
"""
255255
Use the trained model to predict the outputs with a given input image. Path to input image is in the params
256-
dict in a form of {"files", ["path_to_image_1", "path_to_image_2"]}. If it is not specified, then the pre-
257-
diction will use the test images predefined in the bundle config.
256+
dict in a form of {"files", ["path_to_image_1", "path_to_image_2"]}. If it is not specified, then the
257+
prediction will use the test images predefined in the bundle config.
258258
259259
Args:
260260
predict_params: a dict to override the parameters in the bundle config (including the files to predict).
@@ -295,7 +295,9 @@ class BundleGen(AlgoGen):
295295
Args:
296296
algo_path: the directory path to save the algorithm templates. Default is the current working dir.
297297
algos: if dictionary, it outlines the algorithm to use. if None, automatically download the zip file
298-
from the defatult link. if string, it represents the download link.
298+
from the default link. if string, it represents the download link.
299+
The current default options are released at:
300+
https://github.com/Project-MONAI/research-contributions/tree/main/auto3dseg
299301
data_stats_filename: the path to the data stats file (generated by DataAnalyzer)
300302
data_src_cfg_name: the path to the data source config YAML file. The config will be in a form of
301303
{"modality": "ct", "datalist": "path_to_json_datalist", "dataroot": "path_dir_data"}
@@ -332,7 +334,7 @@ def __init__(self, algo_path: str = ".", algos=None, data_stats_filename=None, d
332334
├── configs
333335
│ ├── hyperparameters.yaml # automatically generated yaml from a set of ``template_configs``
334336
│ ├── network.yaml # automatically generated network yaml from a set of ``template_configs``
335-
│ ├── transforms_train.yaml # automatically generated yaml to define tranforms for training
337+
│ ├── transforms_train.yaml # automatically generated yaml to define transforms for training
336338
│ ├── transforms_validate.yaml # automatically generated yaml to define transforms for validation
337339
│ └── transforms_infer.yaml # automatically generated yaml to define transforms for inference
338340
└── scripts

monai/apps/auto3dseg/ensemble_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def ensemble_pred(self, preds, sigmoid=True):
8787
ensemble the results using either "mean" or "vote" method
8888
8989
Args:
90-
preds: a list of probablity prediction in Tensor-Like format.
90+
preds: a list of probability prediction in Tensor-Like format.
9191
sigmoid: use the sigmoid function to threshold probability one-hot map.
9292
9393
Returns:
@@ -205,7 +205,7 @@ class AlgoEnsembleBestByFold(AlgoEnsemble):
205205
Ensemble method that select the best models that are the tops in each fold.
206206
207207
Args:
208-
n_fold: number of cross-valiation folds used in training
208+
n_fold: number of cross-validation folds used in training
209209
"""
210210

211211
def __init__(self, n_fold: int = 5):
@@ -291,7 +291,7 @@ def add_inferer(self, identifier: str, gen_algo: BundleAlgo, best_metric: Option
291291
"""
292292

293293
if best_metric is None:
294-
raise ValueError("Feature to re-valiate is to be implemented")
294+
raise ValueError("Feature to re-validate is to be implemented")
295295

296296
algo = {AlgoEnsembleKeys.ID: identifier, AlgoEnsembleKeys.ALGO: gen_algo, AlgoEnsembleKeys.SCORE: best_metric}
297297
self.infer_algos.append(algo)

monai/apps/auto3dseg/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def export_bundle_algo_history(history: List[Dict[str, BundleAlgo]]):
6060
Save all the BundleAlgo in the history to algo_object.pkl in each individual folder
6161
6262
Args:
63-
history: a List of Bundle. Typicall the history can be obtained from BundleGen get_history method
63+
history: a List of Bundle. Typically, the history can be obtained from BundleGen get_history method
6464
"""
6565
for task in history:
6666
for _, algo in task.items():

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ all =
4646
imagecodecs
4747
pandas
4848
einops
49-
transformers
49+
transformers<4.22
5050
mlflow
5151
matplotlib
5252
tensorboardX
@@ -93,7 +93,7 @@ pandas =
9393
einops =
9494
einops
9595
transformers =
96-
transformers
96+
transformers<4.22
9797
mlflow =
9898
mlflow
9999
matplotlib =

0 commit comments

Comments
 (0)