Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #32

Merged
merged 31 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c415509
1534 type hints numpy 1 20 (#1536)
wyli Feb 2, 2021
5e8d2a9
1512 rand_gaussian_noised with multiple keys (#1530)
rijobro Feb 2, 2021
97ff1e0
1478 Fix TorchScript issue in AHNet with PyTorch 1.5 (#1538)
Nic-Ma Feb 2, 2021
26581a0
1533 Fix distributed data parallel issue in ClassificationSaver (#1535)
Nic-Ma Feb 3, 2021
fbab554
1539 Add warning message to SmartCache (#1540)
Nic-Ma Feb 3, 2021
f7565bf
1531 Fix evenly divisible issue in the AUC metric (#1532)
Nic-Ma Feb 3, 2021
2021f24
1525 add MultiScaleLoss (#1544)
kate-sann5100 Feb 4, 2021
bcdee8c
1542 Add RandLambdad transform (#1546)
Nic-Ma Feb 4, 2021
5a237c6
1555 Fix typo in SegResNet doc-string (#1563)
Nic-Ma Feb 8, 2021
aab702a
[DLMED] Enhance doc-string of transforms (#1562)
Nic-Ma Feb 8, 2021
866d53d
extention -> extension (#1565)
wyli Feb 8, 2021
8d70890
1570 Fix distributed issue in ClassificationSaver (#1571)
Nic-Ma Feb 9, 2021
910b1d4
1556 Optimize the numpy computation for spatial axes (#1572)
Nic-Ma Feb 9, 2021
af1ffd6
Add base class for TensorBoard handlers (#1573)
Nic-Ma Feb 10, 2021
3bdf0c8
1559 add DVF2DDF (#1566)
kate-sann5100 Feb 18, 2021
3f16c21
Modify dynunet forward function (#1596)
yiheng-wang-nv Feb 19, 2021
1b170d8
Add deepgrow dataset (#1581)
YuanTingHsieh Feb 20, 2021
181f633
1568 Enhance tests to use self random state (#1599)
Nic-Ma Feb 21, 2021
19a9f05
Revert "1568 Enhance tests to use self random state (#1599)" (#1607)
wyli Feb 21, 2021
5b72d05
Update minimum ITK version to 5.0 (#1609)
adamaji Feb 22, 2021
e9bf574
Throw warning when reading NRRD05 files to upgrade to ITK >= 5.2 (#1602)
adamaji Feb 22, 2021
5dffc11
Add deepgrow interaction (#1582)
YuanTingHsieh Feb 22, 2021
46cc0e5
Add deepgrow training transforms (#1579)
YuanTingHsieh Feb 22, 2021
a664506
1575 Add SaveImage and SaveImaged transforms (#1612)
Nic-Ma Feb 23, 2021
75b78cd
1545 upgrade base image to pytorch 20.12 (#1613)
wyli Feb 23, 2021
cb5f899
1578 Add support to resume previous best metrics in CheckpointSaver (…
Nic-Ma Feb 23, 2021
d22c112
1618 Fixes Dockerfile (#1619)
wyli Feb 23, 2021
3e7f53f
determine if is_quick without using decorator (#1620)
rijobro Feb 23, 2021
a894adc
make random inverse affine matrix (#1621)
rijobro Feb 23, 2021
6bdc8c6
Compose len (#1622)
rijobro Feb 23, 2021
db2dbb0
unify progress bar for datasets (#1625)
rijobro Feb 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,38 @@ jobs:
fail_ci_if_error: false
file: ./coverage.xml

cron-pt-image:
if: github.repository == 'Project-MONAI/MONAI'
container:
image: nvcr.io/nvidia/pytorch:20.12-py3 # testing with the latest pytorch base image
options: "--gpus all"
runs-on: [self-hosted, linux, x64, common]
steps:
- uses: actions/checkout@v2
- name: Install the dependencies
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
python -m pip list
- name: Run tests report coverage
run: |
export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ]
echo "Sleep $LAUNCH_DELAY"
sleep $LAUNCH_DELAY
nvidia-smi
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
echo $CUDA_VISIBLE_DEVICES
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --coverage
coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
file: ./coverage.xml

cron-docker:
if: github.repository == 'Project-MONAI/MONAI'
container:
Expand All @@ -61,7 +93,8 @@ jobs:
runs-on: [self-hosted, linux, x64, common]
steps:
- name: Run tests report coverage
# The docker image process has done the compilation. BUILD_MONAI=1 may not be necessary.
# The docker image process has done the compilation.
# BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag.
run: |
cd /opt/monai
nvidia-smi
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.10-py3
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.12-py3

FROM ${PYTORCH_IMAGE}

Expand All @@ -21,7 +21,8 @@ WORKDIR /opt/monai
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
RUN cp /tmp/requirements.txt /tmp/req.bak \
&& awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \
&& python -m pip install --no-cache-dir --use-feature=2020-resolver -r /tmp/requirements-dev.txt
&& python -m pip install --upgrade --no-cache-dir pip \
&& python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt

# compile ext and remove temp files
# TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
torch>=1.5
pytorch-ignite==0.4.2
numpy>=1.17
itk
itk>=5.0
nibabel
parameterized
scikit-image>=0.14.2
Expand Down
24 changes: 24 additions & 0 deletions docs/source/apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,27 @@ Applications
.. autofunction:: extractall

.. autofunction:: download_and_extract

`Deepgrow`
----------

.. automodule:: monai.apps.deepgrow.dataset
.. autofunction:: create_dataset

.. automodule:: monai.apps.deepgrow.interaction
.. autoclass:: Interaction
:members:

.. automodule:: monai.apps.deepgrow.transforms
.. autoclass:: AddInitialSeedPointd
:members:
.. autoclass:: AddGuidanceSignald
:members:
.. autoclass:: AddRandomGuidanced
:members:
.. autoclass:: SpatialCropForegroundd
:members:
.. autoclass:: FindDiscrepancyRegionsd
:members:
.. autoclass:: FindAllValidSlicesd
:members:
3 changes: 3 additions & 0 deletions docs/source/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ Training stats handler

Tensorboard handlers
--------------------
.. autoclass:: TensorBoardHandler
:members:

.. autoclass:: TensorBoardStatsHandler
:members:

Expand Down
8 changes: 8 additions & 0 deletions docs/source/losses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,12 @@ Registration Losses
`GlobalMutualInformationLoss`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: GlobalMutualInformationLoss
:members:

Loss Wrappers
--------------

`MultiScaleLoss`
~~~~~~~~~~~~~~~~~
.. autoclass:: MultiScaleLoss
:members:
13 changes: 9 additions & 4 deletions docs/source/networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ Blocks
.. autoclass:: SubpixelUpSample

`LocalNet DownSample Block`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: LocalNetDownSampleBlock
:members:

`LocalNet UpSample Block`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: LocalNetUpSampleBlock
:members:

Expand All @@ -135,10 +135,15 @@ Blocks
:members:

`Warp`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~
.. autoclass:: Warp
:members:

`DVF2DDF`
~~~~~~~~~
.. autoclass:: DVF2DDF
:members:

Layers
------

Expand Down Expand Up @@ -201,7 +206,7 @@ Layers
~~~~~~~~~~~~~~~~
.. autoclass:: GaussianFilter
:members:

`BilateralFilter`
~~~~~~~~~~~~~~~~~
.. autoclass:: BilateralFilter
Expand Down
18 changes: 18 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ IO
:members:
:special-members: __call__

`SaveImage`
"""""""""""
.. autoclass:: SaveImage
:members:
:special-members: __call__

Post-processing
^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -702,6 +708,12 @@ IO (Dict)
:members:
:special-members: __call__

`SaveImaged`
""""""""""""
.. autoclass:: SaveImaged
:members:
:special-members: __call__

Post-processing (Dict)
^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -939,6 +951,12 @@ Utility (Dict)
:members:
:special-members: __call__

`RandLambdad`
"""""""""""""
.. autoclass:: RandLambdad
:members:
:special-members: __call__

`LabelToMaskd`
""""""""""""""
.. autoclass:: LabelToMaskd
Expand Down
8 changes: 6 additions & 2 deletions monai/apps/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def __init__(
data = self._generate_data_list(dataset_dir)
if transform == ():
transform = LoadImaged("image")
super().__init__(data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers)
CacheDataset.__init__(
self, data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers
)

def randomize(self, data: Optional[Any] = None) -> None:
self.rann = self.R.random()
Expand Down Expand Up @@ -275,7 +277,9 @@ def __init__(
self._properties = load_decathlon_properties(os.path.join(dataset_dir, "dataset.json"), property_keys)
if transform == ():
transform = LoadImaged(["image", "label"])
super().__init__(data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers)
CacheDataset.__init__(
self, data, transform, cache_num=cache_num, cache_rate=cache_rate, num_workers=num_workers
)

def get_indices(self) -> np.ndarray:
"""
Expand Down
10 changes: 10 additions & 0 deletions monai/apps/deepgrow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Loading