Skip to content

Commit aaeb129

Browse files
upgrade monai to 0.8.0 version + fix handler + tag support for docker… (#548)
* upgrade monai to 0.8.0 version + fix handler + tag support for docker build Signed-off-by: Sachidanand Alle <[email protected]> * update install docs for DockerHub install method Signed-off-by: Sachidanand Alle <[email protected]>
1 parent bd518af commit aaeb129

File tree

5 files changed

+48
-34
lines changed

5 files changed

+48
-34
lines changed

.github/workflows/docker.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: docker
2-
on: workflow_dispatch
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: 'Tag name to publish'
7+
required: true
8+
default: 'latest'
39

410
jobs:
511
docker_build:
@@ -22,18 +28,18 @@ jobs:
2228
sudo apt-get install docker-ce
2329
- name: Build
2430
run: |
25-
DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:latest -f Dockerfile .
31+
DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:${{ github.event.inputs.tag }} -f Dockerfile .
2632
- name: Publish
2733
run: |
2834
echo "${{ secrets.DOCKER_PW }}" | docker login -u projectmonai --password-stdin
29-
docker push projectmonai/monailabel:latest
35+
docker push projectmonai/monailabel:${{ github.event.inputs.tag }}
3036
docker logout
3137
docker image prune -f
3238
3339
docker_test_dockerhub:
3440
needs: docker_build
3541
container:
36-
image: docker://projectmonai/monailabel:latest
42+
image: docker://projectmonai/monailabel:${{ github.event.inputs.tag }}
3743
options: "--shm-size=4g --ipc=host"
3844
runs-on: ubuntu-latest
3945
steps:

docs/source/installation.rst

+8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ The milestone versions are currently planned and released every few months. As
6262
codebase is under active development, you may want to install MONAI from GitHub
6363
for the latest features
6464

65+
From DockerHub
66+
**************
67+
To install latest from `DockerHub <https://hub.docker.com/r/projectmonai/monailabel>`_:
68+
::
69+
70+
docker run -it --rm --gpus all --ipc=host --net=host -v ~:/workspace/ projectmonai/monailabel:latest bash
71+
72+
6573
MONAI Label CLI
6674
---------------
6775
Simple *monailabel* command will help user to download sample apps, datasets and run server.

monailabel/deepedit/handlers.py

+28-28
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ def __call__(self, engine: Engine) -> None:
139139
)
140140
plot_2d_or_3d_image(
141141
# add batch dim and plot the first item
142-
show_image[None],
143-
step,
144-
self._writer,
145-
0,
146-
self.max_channels,
147-
self.max_frames,
148-
"step_" + str(step) + "_image_" + filename,
142+
data=show_image[None],
143+
step=step,
144+
writer=self._writer,
145+
index=0,
146+
max_channels=self.max_channels,
147+
max_frames=self.max_frames,
148+
tag="step_" + str(step) + "_image_" + filename,
149149
)
150150

151151
"""
@@ -162,13 +162,13 @@ def __call__(self, engine: Engine) -> None:
162162
)
163163
plot_2d_or_3d_image(
164164
# add batch dim and plot the first item
165-
show_label[None],
166-
step,
167-
self._writer,
168-
0,
169-
self.max_channels,
170-
self.max_frames,
171-
"step_" + str(step) + "_label_" + filename,
165+
data=show_label[None],
166+
step=step,
167+
writer=self._writer,
168+
index=0,
169+
max_channels=self.max_channels,
170+
max_frames=self.max_frames,
171+
tag="step_" + str(step) + "_label_" + filename,
172172
)
173173

174174
"""
@@ -187,13 +187,13 @@ def __call__(self, engine: Engine) -> None:
187187
)
188188
plot_2d_or_3d_image(
189189
# add batch dim and plot the first item
190-
show_prediction[None],
191-
step,
192-
self._writer,
193-
0,
194-
self.max_channels,
195-
self.max_frames,
196-
"step_" + str(step) + f"_prediction_for_label_{str(idx)}_" + filename,
190+
data=show_prediction[None],
191+
step=step,
192+
writer=self._writer,
193+
index=0,
194+
max_channels=self.max_channels,
195+
max_frames=self.max_frames,
196+
tag="step_" + str(step) + f"_prediction_for_label_{str(idx)}_" + filename,
197197
)
198198

199199
"""
@@ -214,13 +214,13 @@ def __call__(self, engine: Engine) -> None:
214214
show_pos_clicks = show_label * (1 - show_pos_clicks)
215215
plot_2d_or_3d_image(
216216
# add batch dim and plot the first item
217-
show_pos_clicks[None],
218-
step,
219-
self._writer,
220-
0,
221-
self.max_channels,
222-
self.max_frames,
223-
"step_" + str(step) + "_all_clicks_" + filename,
217+
data=show_pos_clicks[None],
218+
step=step,
219+
writer=self._writer,
220+
index=0,
221+
max_channels=self.max_channels,
222+
max_frames=self.max_frames,
223+
tag="step_" + str(step) + "_all_clicks_" + filename,
224224
)
225225

226226
self._writer.flush()

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiofiles==0.6.0
22
fastapi==0.65.2
3-
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0rc3
3+
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0
44
pyyaml==5.4.1
55
python-multipart==0.0.5
66
requests-toolbelt==0.9.1

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ setup_requires =
2626
install_requires =
2727
aiofiles==0.6.0
2828
fastapi==0.65.2
29-
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0rc3
29+
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0
3030
pyyaml==5.4.1
3131
python-multipart==0.0.5
3232
requests-toolbelt==0.9.1

0 commit comments

Comments
 (0)