Skip to content

Commit

Permalink
update nnunet version and refactor env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Soni committed Jun 17, 2024
1 parent 07adc87 commit f48bf52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions models/bamf_nnunet_mr_breast/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM mhubai/base:latest
ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True

# Install nnunet and platipy
RUN pip3 install --no-cache-dir nnunet==1.7.1
RUN pip3 install --no-cache-dir nnunetv2

# Clone the main branch of MHubAI/models
ARG MHUB_MODELS_REPO
Expand All @@ -18,15 +18,15 @@ RUN buildutils/import_mhub_model.sh bamf_nnunet_mr_breast ${MHUB_MODELS_REPO}
ENV WEIGHTS_DIR=/root/.nnunet/nnUNet_models/nnUNet/
RUN mkdir -p $WEIGHTS_DIR
ENV WEIGHTS_FN=Dataset009_Breast.zip
ENV WEIGHTS_URL=https://zenodo.org/record/11503782/files/$WEIGHTS_FN
ENV WEIGHTS_URL=https://zenodo.org/record/11998679/files/$WEIGHTS_FN
RUN wget --directory-prefix ${WEIGHTS_DIR} ${WEIGHTS_URL}
RUN unzip ${WEIGHTS_DIR}${WEIGHTS_FN} -d ${WEIGHTS_DIR}
RUN rm ${WEIGHTS_DIR}${WEIGHTS_FN}

# Pull nnUNet model weights into the container for Task775_CT_NSCLC_RG
ENV TASK_NAME_NSCLC_RG=Task775_CT_NSCLC_RG
ENV WEIGHTS_FN=Dataset011_Breast.zip
ENV WEIGHTS_URL=https://zenodo.org/record/11504675/files/$WEIGHTS_FN
ENV WEIGHTS_URL=https://zenodo.org/record/11998632/files/$WEIGHTS_FN
RUN wget --directory-prefix ${WEIGHTS_DIR} ${WEIGHTS_URL}
RUN unzip ${WEIGHTS_DIR}${WEIGHTS_FN} -d ${WEIGHTS_DIR}
RUN rm ${WEIGHTS_DIR}${WEIGHTS_FN}
Expand Down
2 changes: 1 addition & 1 deletion models/bamf_nnunet_mr_breast/utils/NNUnetRunnerV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def task(self, instance: Instance, in_data: InstanceData, out_data: InstanceData

# define output folder (temp dir) and also override environment variable for nnunet
out_dir = self.config.data.requestTempDir(label="nnunet-model-out")
os.environ['nnUNet_results'] = out_dir
os.environ['nnUNet_results'] = os.environ['WEIGHTS_FOLDER'] # set model weights path

# symlink nnunet input folder to the input data with python
# create symlink in python
Expand Down

0 comments on commit f48bf52

Please sign in to comment.