Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.8
|
| 3 |
+
|
| 4 |
+
# Set the working directory to /content
|
| 5 |
+
WORKDIR /content
|
| 6 |
+
|
| 7 |
+
# Clone the repository
|
| 8 |
+
RUN git clone -b dev https://github.com/camenduru/DiffBIR
|
| 9 |
+
|
| 10 |
+
# Change the working directory to /content/DiffBIR
|
| 11 |
+
WORKDIR /content/DiffBIR
|
| 12 |
+
|
| 13 |
+
# Install Python dependencies
|
| 14 |
+
RUN pip install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips
|
| 15 |
+
|
| 16 |
+
# Install open_clip from GitHub
|
| 17 |
+
RUN pip install -q git+https://github.com/mlfoundations/[email protected]
|
| 18 |
+
|
| 19 |
+
# Install aria2
|
| 20 |
+
RUN apt-get update && apt-get install -y aria2
|
| 21 |
+
|
| 22 |
+
# Download checkpoint files using aria2
|
| 23 |
+
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 /content/models -o general_full_v1.ckpt
|
| 24 |
+
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 /content/models -o general_swinir_v1.ckpt
|
| 25 |
+
|
| 26 |
+
# Run the Python script inside the Docker container
|
| 27 |
+
CMD ["python", "gradio_diffbir.py", "--ckpt", "/content/models/general_full_v1.ckpt", "--config", "/content/DiffBIR/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "/content/models/general_swinir_v1.ckpt"]
|