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

refined dockerfile #284

Open
Imbernoulli opened this issue Oct 10, 2023 · 2 comments
Open

refined dockerfile #284

Imbernoulli opened this issue Oct 10, 2023 · 2 comments

Comments

@Imbernoulli
Copy link

Imbernoulli commented Oct 10, 2023

There are many problems with the old docker file, here is the new available one

FROM nvidia/cuda:12.1.0-base-ubuntu20.04

RUN apt update && DEBIAN_FRONTEND=noninteractive apt install git bzip2 wget unzip python3-pip python3-dev cmake libgl1-mesa-dev python-is-python3 libgtk2.0-dev -yq
ADD . /app
WORKDIR /app
RUN cd Face_Enhancement/models/networks/ &&\
  git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch &&\
  cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . &&\
  cd ../../../

RUN cd Global/detection_models &&\
  git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch &&\
  cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . &&\
  cd ../../

RUN cd Face_Detection/ &&\
  wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 &&\
  bzip2 -d shape_predictor_68_face_landmarks.dat.bz2 &&\
  cd ../ 

RUN cd Face_Enhancement/ &&\
  wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip &&\
  unzip face_checkpoints.zip &&\
  cd ../ &&\
  cd Global/ &&\
  wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip &&\
  unzip global_checkpoints.zip &&\
  cd ../

RUN pip3 install numpy

RUN pip3 install dlib

RUN pip3 install -r requirements.txt

RUN git clone https://github.com/NVlabs/SPADE.git

RUN cd SPADE/ && pip3 install -r requirements.txt

RUN cd ..

CMD ["python3", "run.py"]
@Samuel-Hinchliffe
Copy link

You saved my day. 😁

@Imbernoulli
Copy link
Author

You can also use this, which is not dependent (not using ADD) to this repo

FROM nvidia/cuda:12.1.0-base-ubuntu20.04

RUN apt update && DEBIAN_FRONTEND=noninteractive apt install git bzip2 wget unzip python3-pip python3-dev cmake libgl1-mesa-dev python-is-python3 libgtk2.0-dev -yq

RUN git clone https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life.git

RUN cd Bringing-Old-Photos-Back-to-Life/Face_Enhancement/models/networks/ &&\
    git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch &&\
    cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . &&\
    cd ../../../

RUN cd Bringing-Old-Photos-Back-to-Life/Global/detection_models &&\
    git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch &&\
    cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . &&\
    cd ../../

RUN cd Bringing-Old-Photos-Back-to-Life/Face_Detection/ &&\
    wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 &&\
    bzip2 -d shape_predictor_68_face_landmarks.dat.bz2 &&\
    cd ../ 

RUN cd Bringing-Old-Photos-Back-to-Life/Face_Enhancement/ &&\
    wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip &&\
    unzip face_checkpoints.zip &&\
    cd ../ &&\
    cd Global/ &&\
    wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip &&\
    unzip global_checkpoints.zip &&\
    cd ../

RUN pip3 install numpy

RUN pip3 install dlib

RUN pip3 install -r Bringing-Old-Photos-Back-to-Life/requirements.txt

RUN git clone https://github.com/NVlabs/SPADE.git

RUN cd SPADE/ && pip3 install -r requirements.txt

RUN cd ..

CMD ["python3", "run.py"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants