Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download script updated with Dockerfile #112

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
ARG CUDA_VERSION=11.1

# onnxruntime-gpu requires cudnn
ARG CUDNN_VER=8

# See possible types: https://hub.docker.com/r/nvidia/cuda/tags?page=1&ordering=last_updated
ARG IMAGE_TYPE=runtime

FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VER}-${IMAGE_TYPE}-ubuntu20.04 AS builder

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y software-properties-common && \
# the latest version of Git
add-apt-repository ppa:git-core/ppa && \
apt update && \
apt install -y --no-install-recommends \
git ca-certificates wget unzip libgl1-mesa-glx \
&& \
apt autoremove -y && \
apt clean -y

# Install Miniconda See possible versions: https://repo.anaconda.com/miniconda/
ARG CONDA_VERSION=3-py38_4.9.2

ARG CONDA_DIR=/opt/conda

ENV PATH=$CONDA_DIR/bin:$PATH

RUN wget -q -O ./miniconda.sh http://repo.continuum.io/miniconda/Miniconda${CONDA_VERSION}-Linux-x86_64.sh \
&& sh ./miniconda.sh -bfp $CONDA_DIR \
&& rm ./miniconda.sh

WORKDIR /home

COPY ./environment.yml ./environment.yml

RUN conda env update -n base --prune --file ./environment.yml && \
conda clean -ayf && rm ./environment.yml

RUN git clone --single-branch https://github.com/neuralchen/SimSwap.git && \
cd ./SimSwap && \
rm -rf .git && \
./download-weights.sh && \
wget -P ./parsing_model/checkpoint https://github.com/neuralchen/SimSwap/releases/download/1.0/79999_iter.pth


FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VER}-${IMAGE_TYPE}-ubuntu20.04

ARG CONDA_DIR=/opt/conda

# Copy conda installation
COPY --from=builder /opt/conda $CONDA_DIR

ENV PATH=$CONDA_DIR/bin:$PATH

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y --no-install-recommends libgl1-mesa-glx && \
apt autoremove -y && \
apt clean -y

COPY --from=builder /home/SimSwap /home/SimSwap

WORKDIR /home/SimSwap
2 changes: 2 additions & 0 deletions download-weights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ wget --no-check-certificate "https://sh23tw.dm.files.1drv.com/y4mmGiIkNVigkSwOKD
mkdir -p insightface_func/models
unzip ./antelope.zip -d ./insightface_func/models/
rm antelope.zip
wget -P ./parsing_model/checkpoint https://github.com/neuralchen/SimSwap/releases/download/1.0/79999_iter.pth

16 changes: 16 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
channels:
- defaults
- conda-forge
- pytorch
dependencies:
- numpy=1.20.2
- opencv=4.5.0
- pillow=8.2.0
- moviepy
- pip=21.2.2
- pip:
- insightface==0.2.1
- onnxruntime-gpu==1.8.1
- -f https://download.pytorch.org/whl/torch_stable.html
- torch==1.9.0+cu111
- torchvision==0.10.0+cu111