|
|
|
FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime |
|
|
|
|
|
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0 |
|
|
|
RUN apt-get update && apt-get install -y ninja-build |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
PYTHONPATH=$HOME/app \ |
|
PYTHONUNBUFFERED=1 \ |
|
GRADIO_ALLOW_FLAGGING=never \ |
|
GRADIO_NUM_PORTS=1 \ |
|
GRADIO_SERVER_NAME=0.0.0.0 \ |
|
GRADIO_THEME=huggingface \ |
|
GRADIO_SHARE=False \ |
|
SYSTEM=spaces |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
RUN git clone -b main https://github.com/fffiloni/DiffBIR $HOME/app |
|
|
|
|
|
RUN pip install torch==1.12.1 torchvision==0.13.1 pytorch-lightning |
|
|
|
|
|
RUN pip install -q xformers==0.0.16 einops open-clip-torch omegaconf torchmetrics==0.6.0 triton opencv-python-headless scipy matplotlib lpips gradio chardet transformers facexlib pydantic~=1.0 |
|
|
|
|
|
RUN pip install -q git+https://github.com/mlfoundations/open_clip@v2.20.0 |
|
|
|
USER root |
|
|
|
RUN apt-get update && apt-get install -y aria2 |
|
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 |
|
|
|
|
|
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID |
|
ENV CUDA_VISIBLE_DEVICES=0 |
|
|
|
|
|
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"] |