Skip to content

Commit bff4b15

Browse files
authored
Remove source code of numcodecs in the Dockerfile (#7644)
- Remove source code of numcodecs. - Add check for only build from source when arm architecture. - Removed the hardcoding of “python3.10”. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: YunLiu <[email protected]>
1 parent 605ffe1 commit bff4b15

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ FROM ${PYTORCH_IMAGE}
1717
LABEL maintainer="[email protected]"
1818

1919
# TODO: remark for issue [revise the dockerfile](https://github.com/zarr-developers/numcodecs/issues/431)
20-
WORKDIR /opt
21-
RUN git clone --recursive https://github.com/zarr-developers/numcodecs.git && pip wheel numcodecs
20+
RUN if [[ $(uname -m) =~ "aarch64" ]]; then \
21+
cd /opt && \
22+
git clone --branch v0.12.1 --recursive https://github.com/zarr-developers/numcodecs && \
23+
pip wheel numcodecs && \
24+
rm -r /opt/*.whl && \
25+
rm -rf /opt/numcodecs; \
26+
fi
2227

2328
WORKDIR /opt/monai
2429

monai/data/video_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ def get_available_codecs() -> dict[str, str]:
173173
all_codecs = {"mp4v": ".mp4", "X264": ".avi", "H264": ".mp4", "MP42": ".mp4", "MJPG": ".mjpeg", "DIVX": ".avi"}
174174
codecs = {}
175175
with SuppressStderr():
176-
writer = cv2.VideoWriter()
177176
with tempfile.TemporaryDirectory() as tmp_dir:
178177
for codec, ext in all_codecs.items():
178+
writer = cv2.VideoWriter()
179179
fname = os.path.join(tmp_dir, f"test{ext}")
180180
fourcc = cv2.VideoWriter_fourcc(*codec) # type: ignore[attr-defined]
181181
noviderr = writer.open(fname, fourcc, 1, (10, 10))
182182
if noviderr:
183183
codecs[codec] = ext
184-
writer.release()
184+
writer.release()
185185
return codecs
186186

187187
def get_num_frames(self) -> int:

0 commit comments

Comments
 (0)