Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ FROM python:3.12 AS app

ARG APP_FOLDER=/app

COPY . ${APP_FOLDER}
RUN pip install tensorflow totalsegmentator

RUN python `python -c "import os; import totalsegmentator; print(os.path.dirname(totalsegmentator.__file__))"`/download_pretrained_weights.py

# taken from TotalSegmentator Dockerfile
# https://github.com/wasserth/TotalSegmentator/blob/master/Dockerfile
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 xvfb -y
RUN pip install fury

WORKDIR ${APP_FOLDER}

RUN pip install tensorflow
RUN pip install -r requirements.txt
COPY . ${APP_FOLDER}

RUN pip install .

COPY --from=helper /app/weights.keras ${APP_FOLDER}/checkpoints/weights.keras

CMD ["python", "./src/pancreas_ai/bin/predict.py"]
CMD ["predict"]
2 changes: 1 addition & 1 deletion src/pancreas_ai/bin/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def is_ct_folder_exists(self):
return True

def segment(self):
segmentation = totalsegmentator(self.ct_folder, fastest=False)
segmentation = totalsegmentator(self.ct_folder, fastest=False, verbose=True)
nib.save(segmentation, self.mask_file)

def cancer_probability(self) -> np.array:
Expand Down
Loading