lucky0146 commited on
Commit
fd5e38d
·
verified ·
1 Parent(s): b929046

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # System dependencies (no CUDA requirements)
4
+ RUN apt-get update && apt-get install -y \
5
+ cmake \
6
+ build-essential \
7
+ libopenblas-dev \
8
+ libx11-dev \
9
+ libgl1-mesa-glx \
10
+ git \
11
+ wget \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Install CPU-specific PyTorch first
15
+ RUN pip install --upgrade pip && \
16
+ pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cpu
17
+
18
+ # Copy requirements
19
+ COPY requirements.txt .
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Install dlib with CUDA explicitly disabled
23
+ RUN CMAKE_ARGS="-DDLIB_USE_CUDA=0" pip install dlib==19.24.1
24
+
25
+ # Clone CodeFormer
26
+ RUN git clone https://github.com/sczhou/CodeFormer
27
+ WORKDIR /CodeFormer
28
+
29
+ # Create required directory structure
30
+ RUN mkdir -p basicsr/basicsr && \
31
+ echo "# BasicSR" > basicsr/README.md && \
32
+ echo "1.3.2" > basicsr/basicsr/VERSION
33
+
34
+ # Install BasicSR with CPU support
35
+ RUN cd basicsr && \
36
+ python setup.py develop && \
37
+ cd ..
38
+
39
+ # Download models
40
+ RUN python scripts/download_pretrained_models.py facelib
41
+ RUN python scripts/download_pretrained_models.py CodeFormer
42
+
43
+ # Set environment variables
44
+ ENV PYTHONPATH=/CodeFormer:$PYTHONPATH
45
+
46
+ WORKDIR /
47
+ COPY app.py .
48
+
49
+ CMD ["python", "app.py"]