Skip to content

Commit

Permalink
Merge pull request #1018 from NHellFire/feature/arm64
Browse files Browse the repository at this point in the history
Add ARM64 support
  • Loading branch information
pospielov authored Feb 6, 2023
2 parents bd79716 + 43b4953 commit 8e2725d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
33 changes: 33 additions & 0 deletions embedding-calculator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,45 @@ FROM ${BASE_IMAGE:-python:3.7-slim}
RUN apt-get update && apt-get install -y build-essential cmake git wget unzip \
curl yasm pkg-config libswscale-dev libtbb2 libtbb-dev libjpeg-dev \
libpng-dev libtiff-dev libavformat-dev libpq-dev libfreeimage3 python3-opencv \
libaec-dev libblosc-dev libbrotli-dev libbz2-dev libgif-dev libopenjp2-7-dev \
liblcms2-dev libcharls-dev libjxr-dev liblz4-dev libcfitsio-dev libsnappy-dev \
libwebp-dev libzopfli-dev libzstd-dev \
&& rm -rf /var/lib/apt/lists/*

# Dependencies for imagecodecs
WORKDIR /tmp

# brunsli
RUN git clone --depth=1 --shallow-submodules --recursive -b v0.1 https://github.com/google/brunsli && \
cd brunsli && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
make -j$(nproc) install && \
rm -rf /tmp/brunsli

# libjxl
RUN git clone --depth=1 --shallow-submodules --recursive -b v0.7.0 https://github.com/libjxl/libjxl && \
cd libjxl && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF . && \
make -j$(nproc) install && \
rm -rf /tmp/libjxl

# zfp
RUN git clone --depth=1 -b 0.5.5 https://github.com/LLNL/zfp && \
cd zfp && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) install && \
rm -rf /tmp/zfp
# End imagecodecs dependencies

# install common python packages
SHELL ["/bin/bash", "-c"]
WORKDIR /app/ml
COPY requirements.txt .
# Ensure numpy is installed first as imagecodecs doesn't declare dependencies correctly until 2022.9.26,
# which is not compatible with Python 3.7
RUN pip --no-cache-dir install $(grep ^numpy requirements.txt)
RUN pip --no-cache-dir install -r requirements.txt

ARG BE_VERSION
Expand Down
8 changes: 4 additions & 4 deletions embedding-calculator/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ pylama~=7.7.1

# dependencies for both scanner backends
Pillow~=9.2.0
imagecodecs~=2020.5.30
imagecodecs~=2021.11.20
numpy~=1.21
scipy~=1.5.4
opencv-python~=4.4.0
scikit-learn~=0.23.2
scikit-image~=0.17.2
opencv-python~=4.5.0
scikit-learn~=0.24.2
scikit-image~=0.18.3
joblib~=1.2.0

# web server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

requirements = ('tensorflow~=2.1.4', 'tf-slim~=1.1.0')
requirements = ('tensorflow~=2.11.0', 'tf-slim~=1.1.0')
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from src.services.utils.pyutils import get_env


def get_tensorflow(version='2.1.4') -> Tuple[str, ...]:
def get_tensorflow(version='2.11.0') -> Tuple[str, ...]:
libs = [f'tensorflow=={version}']
cuda_version = get_env('CUDA', '').replace('.', '')
if ENV.GPU_IDX > -1 and cuda_version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

from src.services.facescan.plugins.dependencies import get_tensorflow

requirements = ('protobuf~=3.20.1',) + get_tensorflow() # + ('mtcnn~=0.1.0',)
requirements = ('protobuf~=3.19.6',) + get_tensorflow() # + ('mtcnn~=0.1.0',)

0 comments on commit 8e2725d

Please sign in to comment.