Skip to content

Commit fbe890c

Browse files
author
David Straub
committed
Remove not working torch install and opencv for armv7l; add opencv-contrib
1 parent 87067d6 commit fbe890c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,17 @@ RUN python3 -m pip install --break-system-packages --no-cache-dir --extra-index-
6868

6969
# Install PyTorch based on architecture
7070
RUN ARCH=$(uname -m) && \
71-
if [ "$ARCH" = "armv7l" ]; then \
72-
# Install the armv7l-specific PyTorch wheel
73-
python3 -m pip install --break-system-packages --no-cache-dir \
74-
https://github.com/maxisoft/pytorch-arm/releases/download/v1.0.0/torch-1.13.0a0+git7c98e70-cp311-cp311-linux_armv7l.whl; \
75-
else \
76-
# Install PyTorch from the official index for other architectures
71+
if [ "$ARCH" != "armv7l" ]; then \
72+
# PyTorch and opencv not supported on armv7l
7773
python3 -m pip install --break-system-packages --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch; \
74+
python3 -m pip install --break-system-packages --no-cache-dir --extra-index-url https://www.piwheels.org/simple \
75+
opencv-python opencv-contrib-python; \
7876
fi
7977

8078
# copy package source and install
8179
COPY . /app/src
8280
RUN python3 -m pip install --break-system-packages --no-cache-dir --extra-index-url https://www.piwheels.org/simple \
83-
opencv-python scikit-learn==1.4.2 numpy==1.26.4 /app/src[ai]
81+
scikit-learn==1.4.2 numpy==1.26.4 /app/src[ai]
8482

8583
# download and cache sentence transformer model
8684
RUN python3 -c "\

0 commit comments

Comments
 (0)