Skip to content

Commit 56ee2cc

Browse files
committed
changed docker files
1 parent 7748ef7 commit 56ee2cc

3 files changed

Lines changed: 25 additions & 7 deletions

File tree

src/baseline/v2/inference/docker/Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@ FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
22

33
WORKDIR /app
44

5-
# system deps
5+
# -----------------------------
6+
# System dependencies
7+
# -----------------------------
68
RUN apt-get update && apt-get install -y \
79
git \
810
wget \
911
&& rm -rf /var/lib/apt/lists/*
1012

11-
# python deps
13+
# -----------------------------
14+
# Python dependencies
15+
# -----------------------------
1216
COPY requirements.txt .
17+
18+
# remove torchvision (not needed + removes warning)
19+
RUN pip uninstall -y torchvision || true
20+
1321
RUN pip install --no-cache-dir -r requirements.txt
1422

15-
# copy code
23+
# -----------------------------
24+
# Copy code
25+
# -----------------------------
1626
COPY . .
1727

18-
# run inference
28+
# -----------------------------
29+
# Run inference
30+
# -----------------------------
1931
ENTRYPOINT ["python", "inference.py"]

src/baseline/v2/inference/docker/inference.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515

1616
from models.unet import build_model
17-
17+
import time
1818

1919
# -----------------------------
2020
# ARGUMENTS
@@ -25,6 +25,9 @@
2525
parser.add_argument("--output", required=True, help="Path to save pseudo CT")
2626
args = parser.parse_args()
2727

28+
total_start = time.time()
29+
30+
2831
INPUT_PATH = Path(args.input)
2932
OUTPUT_PATH = Path(args.output)
3033

@@ -99,4 +102,7 @@
99102
str(OUTPUT_PATH)
100103
)
101104

102-
print("Saved:", OUTPUT_PATH)
105+
print("Saved:", OUTPUT_PATH)
106+
107+
total_end = time.time()
108+
print(f"Total runtime: {total_end - total_start:.2f} seconds")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
monai
1+
monai==1.3.0
22
nibabel
33
tqdm

0 commit comments

Comments
 (0)