Skip to content
Snippets Groups Projects
Dockerfile 1.16 KiB
Newer Older
FROM reallibrephotos/librephotos-base:dev
Niaz's avatar
Niaz committed

# Build and install dlib
Niaz Faridani-Rad's avatar
Niaz Faridani-Rad committed
# Compile it WITHOUT AVX and SSE4 instructions to ensure compatibility
Manuel's avatar
Manuel committed
WORKDIR /tmp/builds
Niaz Faridani-Rad's avatar
Niaz Faridani-Rad committed
RUN git clone --depth 1 --branch 'v19.24' https://github.com/davisking/dlib.git && \
Manuel's avatar
Manuel committed
    mkdir dlib/build && \
    cd dlib/build && \
Niaz's avatar
Niaz committed
    cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=0 -DLIB_NO_GUI_SUPPORT=0 && \
    cmake --build . && \
Manuel's avatar
Manuel committed
    cd /tmp/builds/dlib && \
Jc Miñarro's avatar
Jc Miñarro committed
    python3 setup.py install --no USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA --no USE_SSE4_INSTRUCTIONS && \
    rm -rf /tmp/builds/* 
Niaz's avatar
Niaz committed

Niaz Faridani-Rad's avatar
Niaz Faridani-Rad committed
# Download pretrained models
Manuel's avatar
Manuel committed
WORKDIR /data_models
RUN mkdir -p /root/.cache/torch/hub/checkpoints/ && \
	curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/places365.tar.gz | tar -zxC /data_models/ && \
	curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz | tar -zxC /data_models/ && \
	curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz | tar -zxC /data_models/ && \
	curl -SL https://download.pytorch.org/models/resnet152-b121ed2d.pth -o /root/.cache/torch/hub/checkpoints/resnet152-b121ed2d.pth