Upload 2 files
Browse files- Dockerfile +49 -0
- requirements.txt +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install necessary system dependencies
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y --no-install-recommends \
|
| 10 |
+
unzip \
|
| 11 |
+
git \
|
| 12 |
+
# Add potential ITK/build dependencies (might need adjustment)
|
| 13 |
+
build-essential \
|
| 14 |
+
cmake \
|
| 15 |
+
libgl1 \
|
| 16 |
+
libglib2.0-0 \
|
| 17 |
+
# libitk5-dev # Removed: Rely on pip install of itk-elastix
|
| 18 |
+
&& \
|
| 19 |
+
rm -rf /var/lib/apt/lists/*
|
| 20 |
+
|
| 21 |
+
# Copy the requirements file first to leverage Docker cache
|
| 22 |
+
COPY requirements.txt .
|
| 23 |
+
|
| 24 |
+
# Install Python packages specified in requirements.txt
|
| 25 |
+
# Using --no-cache-dir can reduce image size
|
| 26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
+
|
| 28 |
+
# --- HD-BET is now copied locally via src/BrainIAC ---
|
| 29 |
+
|
| 30 |
+
# Copy the rest of the application code (including local HD_BET)
|
| 31 |
+
COPY src/BrainIAC /app/BrainIAC
|
| 32 |
+
|
| 33 |
+
# Copy static files (like images)
|
| 34 |
+
COPY src/BrainIAC/static /app/BrainIAC/static
|
| 35 |
+
|
| 36 |
+
# Copy the MNI templates and parameter files
|
| 37 |
+
COPY src/BrainIAC/golden_image /app/BrainIAC/golden_image
|
| 38 |
+
|
| 39 |
+
# Copy the HD-BET models
|
| 40 |
+
COPY src/BrainIAC/hdbet_model /app/BrainIAC/hdbet_model
|
| 41 |
+
|
| 42 |
+
# Copy the MCI classification model checkpoint
|
| 43 |
+
COPY src/BrainIAC/checkpoints/mci_model.pt /app/BrainIAC/checkpoints/mci_model.pt
|
| 44 |
+
|
| 45 |
+
# Make port 7860 available (for Gradio)
|
| 46 |
+
EXPOSE 7860
|
| 47 |
+
|
| 48 |
+
# Run app_gradio.py when the container launches using python
|
| 49 |
+
CMD ["python", "/app/BrainIAC/app_gradio.py"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pytorch-lightning==2.3.3
|
| 2 |
+
monai==1.3.2
|
| 3 |
+
nibabel==5.2.1
|
| 4 |
+
scikit-image==0.21.0
|
| 5 |
+
scikit-learn==1.2.2
|
| 6 |
+
scipy==1.10.1
|
| 7 |
+
seaborn==0.12.2
|
| 8 |
+
numpy==1.23.5
|
| 9 |
+
autograd==1.7.0
|
| 10 |
+
matplotlib==3.7.1
|
| 11 |
+
SimpleITK==2.4.0
|
| 12 |
+
tqdm
|
| 13 |
+
pydicom
|
| 14 |
+
wandb
|
| 15 |
+
lifelines
|
| 16 |
+
torch==2.6.0
|
| 17 |
+
opencv-python
|
| 18 |
+
pandas
|
| 19 |
+
Flask
|
| 20 |
+
gunicorn
|
| 21 |
+
PyYAML
|
| 22 |
+
dicom2nifti
|
| 23 |
+
itk-elastix
|
| 24 |
+
gradio
|