Skip to content

Commit

Permalink
ADD: docker apps (#30)
Browse files Browse the repository at this point in the history
* use WSIRUN_ env var prefix for wsi_run cli

* set model and weights for brca model

* add dockerfiles for task-specific docker images
  • Loading branch information
kaczmarj authored Oct 29, 2022
1 parent 4a5ae6d commit 295bbb7
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
12 changes: 12 additions & 0 deletions dockerfiles/tils.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Tumor-infiltrating lymphocyte detection model.
#
# Note about versioning: We should not use the 'latest' tag because it is a moving
# target. We should prefer using a versioned release of the wsi_inference pipeline.
FROM kaczmarj/patch-classification-pipeline:v0.2.0

# The CLI will use these env vars for model and weights.
ENV WSIRUN_MODEL="inceptionv4"
ENV WSIRUN_WEIGHTS="TCGA-TILs-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
12 changes: 8 additions & 4 deletions dockerfiles/tumor-brca.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#
# Note about versioning: We should not use the 'latest' tag because it is a moving
# target. We should prefer using a versioned release of the wsi_inference pipeline.
FROM kaczmarj/patch-classification-pipeline:v0.1.0
# Download the TCGA-BRCA-v1 weights for resnet34.
RUN python -c 'from wsi_inference.modellib import models; models.resnet34("TCGA-BRCA-v1")'
LABEL maintainer="Jakub Kaczmarzyk <[email protected]>"
FROM kaczmarj/patch-classification-pipeline:v0.2.0

# The CLI will use these env vars for model and weights.
ENV WSIRUN_MODEL="resnet34"
ENV WSIRUN_WEIGHTS="TCGA-BRCA-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
12 changes: 12 additions & 0 deletions dockerfiles/tumor-luad.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Lung adenocarcinoma detection model.
#
# Note about versioning: We should not use the 'latest' tag because it is a moving
# target. We should prefer using a versioned release of the wsi_inference pipeline.
FROM kaczmarj/patch-classification-pipeline:v0.2.0

# The CLI will use these env vars for model and weights.
ENV WSIRUN_MODEL="resnet34"
ENV WSIRUN_WEIGHTS="TCGA-LUAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
12 changes: 12 additions & 0 deletions dockerfiles/tumor-paad.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Pancreatic adenocarcinoma detection model.
#
# Note about versioning: We should not use the 'latest' tag because it is a moving
# target. We should prefer using a versioned release of the wsi_inference pipeline.
FROM kaczmarj/patch-classification-pipeline:v0.2.0

# The CLI will use these env vars for model and weights.
ENV WSIRUN_MODEL="resnet34_preact"
ENV WSIRUN_WEIGHTS="TCGA-PAAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
12 changes: 12 additions & 0 deletions dockerfiles/tumor-prad.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Prostate adenocarcinoma detection model.
#
# Note about versioning: We should not use the 'latest' tag because it is a moving
# target. We should prefer using a versioned release of the wsi_inference pipeline.
FROM kaczmarj/patch-classification-pipeline:v0.2.0

# The CLI will use these env vars for model and weights.
ENV WSIRUN_MODEL="resnet34"
ENV WSIRUN_WEIGHTS="TCGA-PRAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
2 changes: 1 addition & 1 deletion wsi_inference/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _print_system_info() -> None:
click.secho("*******************************************", fg="yellow")


@click.command()
@click.command(context_settings=dict(auto_envvar_prefix="WSIRUN"))
@click.pass_context
@click.option(
"--wsi_dir",
Expand Down

0 comments on commit 295bbb7

Please sign in to comment.