|
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get install -y python3.9 |
|
|
|
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y sudo && apt-get install -y python3-pip && pip3 install --upgrade pip |
|
RUN apt-get install -y curl gnupg wget htop sudo git git-lfs software-properties-common build-essential libgl1 zip unzip |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
RUN git clone -b dev https://github.com/camenduru/DiffBIR $HOME/app |
|
|
|
|
|
|
|
|
|
|
|
RUN pip3 install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips opencv-python |
|
|
|
|
|
RUN pip3 install -q git+https://github.com/mlfoundations/open_clip@v2.20.0 |
|
|
|
|
|
USER root |
|
RUN apt-get update && apt-get install -y sudo wget libgl1-mesa-glx && \ |
|
wget https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.gz && \ |
|
tar -xzvf aria2-1.36.0.tar.gz && \ |
|
cd aria2-1.36.0 && \ |
|
./configure && \ |
|
make && \ |
|
make install && \ |
|
cd .. && \ |
|
rm -rf aria2-1.36.0 && \ |
|
rm aria2-1.36.0.tar.gz |
|
|
|
|
|
USER user |
|
|
|
|
|
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt -d $HOME/app/models -o general_full_v1.ckpt |
|
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt -d $HOME/app/models -o general_swinir_v1.ckpt |
|
|
|
|
|
|
|
|
|
RUN find $HOME/app |
|
|
|
|
|
CMD ["python", "gradio_diffbir.py", "--ckpt", "/home/user/app/models/general_full_v1.ckpt", "--config", "/home/user/app/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "/home/user/app/models/general_swinir_v1.ckpt"] |