Skip to content

Commit

Permalink
upgrade monai to 0.8.0 version + fix handler + tag support for docker… (
Browse files Browse the repository at this point in the history
#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]>
  • Loading branch information
SachidanandAlle authored Nov 27, 2021
1 parent bd518af commit aaeb129
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 34 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: docker
on: workflow_dispatch
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag name to publish'
required: true
default: 'latest'

jobs:
docker_build:
Expand All @@ -22,18 +28,18 @@ jobs:
sudo apt-get install docker-ce
- name: Build
run: |
DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:latest -f Dockerfile .
DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:${{ github.event.inputs.tag }} -f Dockerfile .
- name: Publish
run: |
echo "${{ secrets.DOCKER_PW }}" | docker login -u projectmonai --password-stdin
docker push projectmonai/monailabel:latest
docker push projectmonai/monailabel:${{ github.event.inputs.tag }}
docker logout
docker image prune -f
docker_test_dockerhub:
needs: docker_build
container:
image: docker://projectmonai/monailabel:latest
image: docker://projectmonai/monailabel:${{ github.event.inputs.tag }}
options: "--shm-size=4g --ipc=host"
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 8 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ The milestone versions are currently planned and released every few months. As
codebase is under active development, you may want to install MONAI from GitHub
for the latest features

From DockerHub
**************
To install latest from `DockerHub <https://hub.docker.com/r/projectmonai/monailabel>`_:
::

docker run -it --rm --gpus all --ipc=host --net=host -v ~:/workspace/ projectmonai/monailabel:latest bash


MONAI Label CLI
---------------
Simple *monailabel* command will help user to download sample apps, datasets and run server.
Expand Down
56 changes: 28 additions & 28 deletions monailabel/deepedit/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ def __call__(self, engine: Engine) -> None:
)
plot_2d_or_3d_image(
# add batch dim and plot the first item
show_image[None],
step,
self._writer,
0,
self.max_channels,
self.max_frames,
"step_" + str(step) + "_image_" + filename,
data=show_image[None],
step=step,
writer=self._writer,
index=0,
max_channels=self.max_channels,
max_frames=self.max_frames,
tag="step_" + str(step) + "_image_" + filename,
)

"""
Expand All @@ -162,13 +162,13 @@ def __call__(self, engine: Engine) -> None:
)
plot_2d_or_3d_image(
# add batch dim and plot the first item
show_label[None],
step,
self._writer,
0,
self.max_channels,
self.max_frames,
"step_" + str(step) + "_label_" + filename,
data=show_label[None],
step=step,
writer=self._writer,
index=0,
max_channels=self.max_channels,
max_frames=self.max_frames,
tag="step_" + str(step) + "_label_" + filename,
)

"""
Expand All @@ -187,13 +187,13 @@ def __call__(self, engine: Engine) -> None:
)
plot_2d_or_3d_image(
# add batch dim and plot the first item
show_prediction[None],
step,
self._writer,
0,
self.max_channels,
self.max_frames,
"step_" + str(step) + f"_prediction_for_label_{str(idx)}_" + filename,
data=show_prediction[None],
step=step,
writer=self._writer,
index=0,
max_channels=self.max_channels,
max_frames=self.max_frames,
tag="step_" + str(step) + f"_prediction_for_label_{str(idx)}_" + filename,
)

"""
Expand All @@ -214,13 +214,13 @@ def __call__(self, engine: Engine) -> None:
show_pos_clicks = show_label * (1 - show_pos_clicks)
plot_2d_or_3d_image(
# add batch dim and plot the first item
show_pos_clicks[None],
step,
self._writer,
0,
self.max_channels,
self.max_frames,
"step_" + str(step) + "_all_clicks_" + filename,
data=show_pos_clicks[None],
step=step,
writer=self._writer,
index=0,
max_channels=self.max_channels,
max_frames=self.max_frames,
tag="step_" + str(step) + "_all_clicks_" + filename,
)

self._writer.flush()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiofiles==0.6.0
fastapi==0.65.2
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0rc3
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0
pyyaml==5.4.1
python-multipart==0.0.5
requests-toolbelt==0.9.1
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setup_requires =
install_requires =
aiofiles==0.6.0
fastapi==0.65.2
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0rc3
monai[nibabel, skimage, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, openslide]==0.8.0
pyyaml==5.4.1
python-multipart==0.0.5
requests-toolbelt==0.9.1
Expand Down

0 comments on commit aaeb129

Please sign in to comment.