Skip to content

Commit

Permalink
Fix SiamMask breakage due to a bad OpenCV version check (#8945)
Browse files Browse the repository at this point in the history
Due to a poorly-written version check
(<https://github.com/foolwood/SiamMask/blob/0eaac33050fdcda81c9a25aa307fffa74c182e36/tools/test.py#L285>)
SiamMask will not work with any version of OpenCV greater than 4.9.9.
Cap the version we install to work around it.

Also, switch to the headless version of OpenCV, so that we don't have to
install GUI packages.
  • Loading branch information
SpecLad authored Jan 15, 2025
1 parent 377375b commit d1be6e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions serverless/pytorch/foolwood/siammask/nuclio/function-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- kind: ARG
value: PATH="/root/miniconda3/bin:${PATH}"
- kind: RUN
value: apt update && apt install -y --no-install-recommends wget git ca-certificates libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 && rm -rf /var/lib/apt/lists/*
value: apt update && apt install -y --no-install-recommends wget git ca-certificates && rm -rf /var/lib/apt/lists/*
- kind: RUN
value: wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh &&
chmod +x Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b &&
Expand All @@ -40,7 +40,7 @@ spec:
- kind: RUN
value: git clone https://github.com/foolwood/SiamMask.git
- kind: RUN
value: pip install Cython colorama 'numpy<1.20' requests fire matplotlib numba scipy h5py pandas tqdm tensorboardX opencv_python jsonpickle
value: pip install Cython colorama 'numpy<1.20' requests fire matplotlib numba scipy h5py pandas tqdm tensorboardX 'opencv-python-headless<4.9.10' jsonpickle
- kind: RUN
value: pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
- kind: RUN
Expand Down
4 changes: 2 additions & 2 deletions serverless/pytorch/foolwood/siammask/nuclio/function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- kind: ARG
value: PATH="/root/miniconda3/bin:${PATH}"
- kind: RUN
value: apt update && apt install -y --no-install-recommends wget git ca-certificates libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 && rm -rf /var/lib/apt/lists/*
value: apt update && apt install -y --no-install-recommends wget git ca-certificates && rm -rf /var/lib/apt/lists/*
- kind: RUN
value: wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh &&
chmod +x Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b &&
Expand All @@ -40,7 +40,7 @@ spec:
- kind: RUN
value: git clone https://github.com/foolwood/SiamMask.git
- kind: RUN
value: pip install Cython colorama 'numpy<1.20' requests fire matplotlib numba scipy h5py pandas tqdm tensorboardX opencv_python torch torchvision jsonpickle
value: pip install Cython colorama 'numpy<1.20' requests fire matplotlib numba scipy h5py pandas tqdm tensorboardX 'opencv-python-headless<4.9.10' torch torchvision jsonpickle
- kind: RUN
value: conda install -y gcc_linux-64
- kind: RUN
Expand Down

0 comments on commit d1be6e6

Please sign in to comment.