From 17594f3f15e51d0e187213533b7257194fb2725f Mon Sep 17 00:00:00 2001 From: Eric Kerfoot Date: Fri, 17 Jan 2020 14:44:23 +0000 Subject: [PATCH 1/8] Adding integration test for segmentation with UNet --- monai/utils/generateddata.py | 44 +++++++++++++++++++++++++ runtests.sh | 4 +-- tests/integration_unet2d.py | 63 ++++++++++++++++++++++++++++++++++++ tests/utils.py | 33 ++----------------- 4 files changed, 111 insertions(+), 33 deletions(-) create mode 100644 monai/utils/generateddata.py create mode 100644 tests/integration_unet2d.py diff --git a/monai/utils/generateddata.py b/monai/utils/generateddata.py new file mode 100644 index 0000000000..26904943e1 --- /dev/null +++ b/monai/utils/generateddata.py @@ -0,0 +1,44 @@ +# Copyright 2020 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. + + +import numpy as np + +from monai.utils.arrayutils import rescale_array + + +def create_test_image_2d(width, height, num_objs=12, rad_max=30, noise_max=0.0, num_seg_classes=5): + """ + Return a noisy 2D image with `numObj' circles and a 2D mask image. The maximum radius of the circles is given as + `radMax'. The mask will have `numSegClasses' number of classes for segmentations labeled sequentially from 1, plus a + background class represented as 0. If `noiseMax' is greater than 0 then noise will be added to the image taken from + the uniform distribution on range [0,noiseMax). + """ + image = np.zeros((width, height)) + + for i in range(num_objs): + x = np.random.randint(rad_max, width - rad_max) + y = np.random.randint(rad_max, height - rad_max) + rad = np.random.randint(5, rad_max) + spy, spx = np.ogrid[-x : width - x, -y : height - y] + circle = (spx * spx + spy * spy) <= rad * rad + + if num_seg_classes > 1: + image[circle] = np.ceil(np.random.random() * num_seg_classes) + else: + image[circle] = np.random.random() * 0.5 + 0.5 + + labels = np.ceil(image).astype(np.int32) + + norm = np.random.uniform(0, num_seg_classes * noise_max, size=image.shape) + noisyimage = rescale_array(np.maximum(image, norm)) + + return noisyimage, labels diff --git a/runtests.sh b/runtests.sh index 299b47dee6..a6e06f9198 100755 --- a/runtests.sh +++ b/runtests.sh @@ -6,7 +6,7 @@ set -e homedir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $homedir -#export PYTHONPATH="$homedir:$PYTHONPATH" +export PYTHONPATH="$homedir:$PYTHONPATH" # configuration values doCoverage=false @@ -81,7 +81,7 @@ ${cmdprefix}${cmd} -m unittest # network training/inference/eval tests if [ "$doNetTests" = 'true' ] then - for i in examples/*.py + for i in tests/integration_*.py do echo $i ${cmdprefix}${cmd} $i diff --git a/tests/integration_unet2d.py b/tests/integration_unet2d.py new file mode 100644 index 0000000000..007bfb49cf --- /dev/null +++ b/tests/integration_unet2d.py @@ -0,0 +1,63 @@ +# Copyright 2020 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. + +import sys +from functools import partial + +import torch +import torch.nn as nn +import numpy as np + +from ignite.engine import Events, create_supervised_trainer + +from monai import application, data, networks, utils +import monai.data.augments.augments as augments + + +def run_test(batch_size = 64, train_steps = 100, device = torch.device("cuda:0")): + def generate_test_batch(): + for _ in range(train_steps): + im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) + yield im[None], seg[None].astype(np.float32) + + + def _prepare_batch(batch, device=None, non_blocking=False): + x, y = batch + return torch.from_numpy(x).to(device), torch.from_numpy(y).to(device) + + + net = networks.nets.UNet( + dimensions=2, + in_channels=1, + num_classes=1, + channels=(4, 8, 16, 32), + strides=(2, 2, 2), + num_res_units=2, + ) + + loss = networks.losses.DiceLoss() + opt = torch.optim.Adam(net.parameters(), 1e-4) + src = data.streams.BatchStream(generate_test_batch(), batch_size) + + loss_fn = lambda i, j: loss(i[0], j) + + trainer = create_supervised_trainer(net, opt, loss_fn, device, False, _prepare_batch) + + trainer.run(src,1) + + return trainer.state.output + + +if __name__ == '__main__': + result = run_test() + + sys.exit(0 if result < 1 else 1) + \ No newline at end of file diff --git a/tests/utils.py b/tests/utils.py index f780220b77..2e10a29912 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,7 +15,7 @@ import torch import numpy as np -from monai.utils.arrayutils import rescale_array +from monai.utils.generateddata import create_test_image_2d quick_test_var = "QUICKTEST" @@ -26,35 +26,6 @@ def skip_if_quick(obj): return unittest.skipIf(is_quick, "Skipping slow tests")(obj) -def create_test_image(width, height, num_objs=12, rad_max=30, noise_max=0.0, num_seg_classes=5): - """ - Return a noisy 2D image with `numObj' circles and a 2D mask image. The maximum radius of the circles is given as - `radMax'. The mask will have `numSegClasses' number of classes for segmentations labeled sequentially from 1, plus a - background class represented as 0. If `noiseMax' is greater than 0 then noise will be added to the image taken from - the uniform distribution on range [0,noiseMax). - """ - image = np.zeros((width, height)) - - for i in range(num_objs): - x = np.random.randint(rad_max, width - rad_max) - y = np.random.randint(rad_max, height - rad_max) - rad = np.random.randint(5, rad_max) - spy, spx = np.ogrid[-x : width - x, -y : height - y] - circle = (spx * spx + spy * spy) <= rad * rad - - if num_seg_classes > 1: - image[circle] = np.ceil(np.random.random() * num_seg_classes) - else: - image[circle] = np.random.random() * 0.5 + 0.5 - - labels = np.ceil(image).astype(np.int32) - - norm = np.random.uniform(0, num_seg_classes * noise_max, size=image.shape) - noisyimage = rescale_array(np.maximum(image, norm)) - - return noisyimage, labels - - class ImageTestCase(unittest.TestCase): im_shape = (128, 128) input_channels = 1 @@ -62,7 +33,7 @@ class ImageTestCase(unittest.TestCase): num_classes = 3 def setUp(self): - im, msk = create_test_image(self.im_shape[0], self.im_shape[1], 4, 20, 0, self.num_classes) + im, msk = create_test_image_2d(self.im_shape[0], self.im_shape[1], 4, 20, 0, self.num_classes) self.imt = torch.tensor(im[None, None]) From b002f2a83a416d35bfd8de8d9effa7a1a012cd22 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot Date: Fri, 17 Jan 2020 14:54:58 +0000 Subject: [PATCH 2/8] Update integration_unet2d.py --- tests/integration_unet2d.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/integration_unet2d.py b/tests/integration_unet2d.py index 007bfb49cf..dc1b1b863a 100644 --- a/tests/integration_unet2d.py +++ b/tests/integration_unet2d.py @@ -10,30 +10,25 @@ # limitations under the License. import sys -from functools import partial import torch -import torch.nn as nn import numpy as np -from ignite.engine import Events, create_supervised_trainer +from ignite.engine import create_supervised_trainer -from monai import application, data, networks, utils -import monai.data.augments.augments as augments +from monai import data, networks, utils -def run_test(batch_size = 64, train_steps = 100, device = torch.device("cuda:0")): +def run_test(batch_size=64, train_steps=100, device=torch.device("cuda:0")): def generate_test_batch(): for _ in range(train_steps): im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) yield im[None], seg[None].astype(np.float32) - def _prepare_batch(batch, device=None, non_blocking=False): x, y = batch return torch.from_numpy(x).to(device), torch.from_numpy(y).to(device) - net = networks.nets.UNet( dimensions=2, in_channels=1, @@ -47,17 +42,17 @@ def _prepare_batch(batch, device=None, non_blocking=False): opt = torch.optim.Adam(net.parameters(), 1e-4) src = data.streams.BatchStream(generate_test_batch(), batch_size) - loss_fn = lambda i, j: loss(i[0], j) + def loss_fn(pred, grnd): + return loss(pred[0], grnd) trainer = create_supervised_trainer(net, opt, loss_fn, device, False, _prepare_batch) - trainer.run(src,1) + trainer.run(src, 1) return trainer.state.output -if __name__ == '__main__': +if __name__ == "__main__": result = run_test() - + sys.exit(0 if result < 1 else 1) - \ No newline at end of file From 665f89982865360f27e1babf6adfa59d0d44966a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Fri, 24 Jan 2020 05:20:44 +0800 Subject: [PATCH 3/8] update integration test for MVP --- tests/integration_unet2d.py | 25 ++++++++++++------------- tests/utils.py | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/integration_unet2d.py b/tests/integration_unet2d.py index dc1b1b863a..d17bd07abe 100644 --- a/tests/integration_unet2d.py +++ b/tests/integration_unet2d.py @@ -11,23 +11,22 @@ import sys -import torch import numpy as np - +import torch from ignite.engine import create_supervised_trainer +from torch.utils.data import DataLoader, IterableDataset -from monai import data, networks, utils +from monai import networks, utils def run_test(batch_size=64, train_steps=100, device=torch.device("cuda:0")): - def generate_test_batch(): - for _ in range(train_steps): - im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) - yield im[None], seg[None].astype(np.float32) - def _prepare_batch(batch, device=None, non_blocking=False): - x, y = batch - return torch.from_numpy(x).to(device), torch.from_numpy(y).to(device) + class _TestBatch(IterableDataset): + + def __iter__(self): + for _ in range(train_steps): + im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) + yield im[None], seg[None].astype(np.float32) net = networks.nets.UNet( dimensions=2, @@ -40,12 +39,12 @@ def _prepare_batch(batch, device=None, non_blocking=False): loss = networks.losses.DiceLoss() opt = torch.optim.Adam(net.parameters(), 1e-4) - src = data.streams.BatchStream(generate_test_batch(), batch_size) + src = DataLoader(_TestBatch(), batch_size=batch_size) - def loss_fn(pred, grnd): + def loss_fn(pred, grnd): return loss(pred[0], grnd) - trainer = create_supervised_trainer(net, opt, loss_fn, device, False, _prepare_batch) + trainer = create_supervised_trainer(net, opt, loss_fn, device, False) trainer.run(src, 1) diff --git a/tests/utils.py b/tests/utils.py index 044f0e5517..c2b6de1580 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -26,7 +26,7 @@ def skip_if_quick(obj): return unittest.skipIf(is_quick, "Skipping slow tests")(obj) -class ImageTestCase(unittest.TestCase): +class NumpyImageTestCase2D(unittest.TestCase): im_shape = (128, 128) input_channels = 1 output_channels = 4 From c0c079bcae599afd1a77d798e2b89282bdc9ff1e Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Sat, 25 Jan 2020 07:38:09 +0800 Subject: [PATCH 4/8] enable CI commands --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78321d4916..02efe117ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,10 +9,10 @@ stages: - pip install flake8 - pip install pep8-naming # stop the build if there are Python syntax errors or undefined names - - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --config ./.flake8 + # - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --config ./.flake8 # exit-zero treats all errors as warnings. - # - flake8 . --count --statistics --config ./.flake8 - - ./runtests.sh --quick + - flake8 . --count --statistics --config ./.flake8 + - ./runtests.sh --net - echo "Done with runtests.sh" build-ci-test: From f213fbf6ccfedb9910db984032449d2b64fb15b3 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Sat, 25 Jan 2020 08:09:54 +0800 Subject: [PATCH 5/8] fixes ci test --- tests/integration_unet2d.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/integration_unet2d.py b/tests/integration_unet2d.py index d17bd07abe..5a450726a5 100644 --- a/tests/integration_unet2d.py +++ b/tests/integration_unet2d.py @@ -14,19 +14,21 @@ import numpy as np import torch from ignite.engine import create_supervised_trainer -from torch.utils.data import DataLoader, IterableDataset +from torch.utils.data import DataLoader, Dataset from monai import networks, utils def run_test(batch_size=64, train_steps=100, device=torch.device("cuda:0")): - class _TestBatch(IterableDataset): + class _TestBatch(Dataset): - def __iter__(self): - for _ in range(train_steps): - im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) - yield im[None], seg[None].astype(np.float32) + def __getitem__(self, _unused_id): + im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) + return im[None], seg[None].astype(np.float32) + + def __len__(self): + return train_steps net = networks.nets.UNet( dimensions=2, From f517ea19212636e8cd31420563d3fcdcfbc92916 Mon Sep 17 00:00:00 2001 From: Isaac Yang Date: Fri, 31 Jan 2020 11:06:57 -0800 Subject: [PATCH 6/8] This is just for test if public gitlab CI works. Please ignore this. Include integration tests to see if GPU runner works. --- .gitlab-ci.yml | 8 +++-- README.md | 5 ++- monai/utils/generateddata.py | 44 ++++++++++++++++++++++++++ requirements.txt | 3 +- runtests.sh | 9 +++--- tests/integration_unet2d.py | 60 ++++++++++++++++++++++++++++++++++++ tests/utils.py | 33 ++------------------ 7 files changed, 122 insertions(+), 40 deletions(-) create mode 100644 monai/utils/generateddata.py create mode 100644 tests/integration_unet2d.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78321d4916..a1e4d6877c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,14 +5,16 @@ stages: script: - nvidia-smi - python -m pip install --upgrade pip + - pip uninstall -y torch torchvision - pip install -r requirements.txt + - pip list - pip install flake8 - pip install pep8-naming # stop the build if there are Python syntax errors or undefined names - - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --config ./.flake8 + # - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --config ./.flake8 # exit-zero treats all errors as warnings. - # - flake8 . --count --statistics --config ./.flake8 - - ./runtests.sh --quick + - flake8 . --count --statistics --config ./.flake8 + - ./runtests.sh --net - echo "Done with runtests.sh" build-ci-test: diff --git a/README.md b/README.md index 6a5cfa2893..463045a6b8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ _Contact: _ This document identifies key concepts of project MONAI at a high level, the goal is to facilitate further technical discussions of requirements,roadmap, feasibility and trade-offs. - ## Vision * Develop a community of academic, industrial and clinical researchers collaborating and working on a common foundation of standardized tools. * Create a state-of-the-art, end-to-end training toolkit for healthcare imaging. @@ -242,3 +241,7 @@ This document identifies key concepts of project MONAI at a high level, the goal +test-string inserted here + +This is to test gitlab.com CI configuration and runner + diff --git a/monai/utils/generateddata.py b/monai/utils/generateddata.py new file mode 100644 index 0000000000..26904943e1 --- /dev/null +++ b/monai/utils/generateddata.py @@ -0,0 +1,44 @@ +# Copyright 2020 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. + + +import numpy as np + +from monai.utils.arrayutils import rescale_array + + +def create_test_image_2d(width, height, num_objs=12, rad_max=30, noise_max=0.0, num_seg_classes=5): + """ + Return a noisy 2D image with `numObj' circles and a 2D mask image. The maximum radius of the circles is given as + `radMax'. The mask will have `numSegClasses' number of classes for segmentations labeled sequentially from 1, plus a + background class represented as 0. If `noiseMax' is greater than 0 then noise will be added to the image taken from + the uniform distribution on range [0,noiseMax). + """ + image = np.zeros((width, height)) + + for i in range(num_objs): + x = np.random.randint(rad_max, width - rad_max) + y = np.random.randint(rad_max, height - rad_max) + rad = np.random.randint(5, rad_max) + spy, spx = np.ogrid[-x : width - x, -y : height - y] + circle = (spx * spx + spy * spy) <= rad * rad + + if num_seg_classes > 1: + image[circle] = np.ceil(np.random.random() * num_seg_classes) + else: + image[circle] = np.random.random() * 0.5 + 0.5 + + labels = np.ceil(image).astype(np.int32) + + norm = np.random.uniform(0, num_seg_classes * noise_max, size=image.shape) + noisyimage = rescale_array(np.maximum(image, norm)) + + return noisyimage, labels diff --git a/requirements.txt b/requirements.txt index 6999c4db50..950b6147b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -torch +torch>=1.4 +torchvision pytorch-ignite==0.2.1 numpy pyyaml diff --git a/runtests.sh b/runtests.sh index 299b47dee6..a805455bc1 100755 --- a/runtests.sh +++ b/runtests.sh @@ -6,7 +6,8 @@ set -e homedir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $homedir -#export PYTHONPATH="$homedir:$PYTHONPATH" +export PYTHONPATH="$homedir:$PYTHONPATH" +echo $PYTHONPATH # configuration values doCoverage=false @@ -16,7 +17,7 @@ doDryRun=false doZooTests=false # testing command to run -cmd="python" +cmd="python3" cmdprefix="" @@ -75,13 +76,13 @@ fi # unit tests -${cmdprefix}${cmd} -m unittest +${cmdprefix}${cmd} -m unittest -v # network training/inference/eval tests if [ "$doNetTests" = 'true' ] then - for i in examples/*.py + for i in tests/integration_*.py do echo $i ${cmdprefix}${cmd} $i diff --git a/tests/integration_unet2d.py b/tests/integration_unet2d.py new file mode 100644 index 0000000000..a78297ac44 --- /dev/null +++ b/tests/integration_unet2d.py @@ -0,0 +1,60 @@ +# Copyright 2020 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. + +import sys + +import numpy as np +import torch +from ignite.engine import create_supervised_trainer +from torch.utils.data import DataLoader, IterableDataset + +from monai import networks, utils + + +def run_test(batch_size=64, train_steps=100, device=torch.device("cuda:0")): + + class _TestBatch(IterableDataset): + + def __iter__(self): + for _ in range(train_steps): + im, seg = utils.generateddata.create_test_image_2d(128, 128, noise_max=1, num_objs=4, num_seg_classes=1) + yield im[None], seg[None].astype(np.float32) + + def __len__(self): + return train_steps + + net = networks.nets.UNet( + dimensions=2, + in_channels=1, + num_classes=1, + channels=(4, 8, 16, 32), + strides=(2, 2, 2), + num_res_units=2, + ) + + loss = networks.losses.DiceLoss() + opt = torch.optim.Adam(net.parameters(), 1e-4) + src = DataLoader(_TestBatch(), batch_size=batch_size) + + def loss_fn(pred, grnd): + return loss(pred[0], grnd) + + trainer = create_supervised_trainer(net, opt, loss_fn, device, False) + + trainer.run(src, 1) + + return trainer.state.output + + +if __name__ == "__main__": + result = run_test() + + sys.exit(0 if result < 1 else 1) diff --git a/tests/utils.py b/tests/utils.py index c7f55c7d2b..c2b6de1580 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,7 +15,7 @@ import numpy as np import torch -from monai.utils.arrayutils import rescale_array +from monai.utils.generateddata import create_test_image_2d quick_test_var = "QUICKTEST" @@ -26,35 +26,6 @@ def skip_if_quick(obj): return unittest.skipIf(is_quick, "Skipping slow tests")(obj) -def create_test_image(width, height, num_objs=12, rad_max=30, noise_max=0.0, num_seg_classes=5): - """ - Return a noisy 2D image with `numObj' circles and a 2D mask image. The maximum radius of the circles is given as - `radMax'. The mask will have `numSegClasses' number of classes for segmentations labeled sequentially from 1, plus a - background class represented as 0. If `noiseMax' is greater than 0 then noise will be added to the image taken from - the uniform distribution on range [0,noiseMax). - """ - image = np.zeros((width, height)) - - for i in range(num_objs): - x = np.random.randint(rad_max, width - rad_max) - y = np.random.randint(rad_max, height - rad_max) - rad = np.random.randint(5, rad_max) - spy, spx = np.ogrid[-x : width - x, -y : height - y] - circle = (spx * spx + spy * spy) <= rad * rad - - if num_seg_classes > 1: - image[circle] = np.ceil(np.random.random() * num_seg_classes) - else: - image[circle] = np.random.random() * 0.5 + 0.5 - - labels = np.ceil(image).astype(np.int32) - - norm = np.random.uniform(0, num_seg_classes * noise_max, size=image.shape) - noisyimage = rescale_array(np.maximum(image, norm)) - - return noisyimage, labels - - class NumpyImageTestCase2D(unittest.TestCase): im_shape = (128, 128) input_channels = 1 @@ -62,7 +33,7 @@ class NumpyImageTestCase2D(unittest.TestCase): num_classes = 3 def setUp(self): - im, msk = create_test_image(self.im_shape[0], self.im_shape[1], 4, 20, 0, self.num_classes) + im, msk = create_test_image_2d(self.im_shape[0], self.im_shape[1], 4, 20, 0, self.num_classes) self.imt = im[None, None] self.seg1 = (msk[None, None] > 0).astype(np.float32) From 515cbd4f1d9f27d911ba0a8fcc8b924f23c69518 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 4 Feb 2020 15:28:02 +0000 Subject: [PATCH 7/8] update README.md, pytorch-ignite dep 0.3.0 --- README.md | 10 +++------- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 463045a6b8..ac077c5ebd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This document identifies key concepts of project MONAI at a high level, the goal * Primarily focused on the healthcare researchers who develop DL models for medical imaging ## Goals - * Deliver domain-specific workflow capabilities + * Deliver domain-specific workflow capabilities * Address the end-end “Pain points” when creating medical imaging deep learning workflows. * Provide a robust foundation with a performance optimized system software stack that allows researchers to focus on the research and not worry about software development principles. @@ -136,7 +136,7 @@ This document identifies key concepts of project MONAI at a high level, the goal Configuration-driven workflow assembly - Making workflow instances from configuration file + Making workflow instances from configuration file Convenient for managing hyperparameters @@ -208,7 +208,7 @@ This document identifies key concepts of project MONAI at a high level, the goal - Compatibility with external toolkits + Compatibility with external toolkits XNAT as data source, ITK as preprocessor @@ -241,7 +241,3 @@ This document identifies key concepts of project MONAI at a high level, the goal -test-string inserted here - -This is to test gitlab.com CI configuration and runner - diff --git a/requirements.txt b/requirements.txt index 950b6147b1..b738766f6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ torch>=1.4 torchvision -pytorch-ignite==0.2.1 +pytorch-ignite==0.3.0 numpy pyyaml blinker From e814df5194ac63529a5aacda8ac020bc3e3605c1 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 4 Feb 2020 15:35:27 +0000 Subject: [PATCH 8/8] rm torchvision dep --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b738766f6f..746dd36d0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ torch>=1.4 -torchvision pytorch-ignite==0.3.0 numpy pyyaml