Esmaill1 commited on
Commit ·
072b348
1
Parent(s): 3365dbf
Refactor Dockerfile and start script; remove unused dependencies and streamline setup
Browse files- Dockerfile +1 -8
- id-maker/assets/frame-default.png +0 -0
- id-maker/config/settings.json +3 -0
- requirements.txt +1 -11
- start.sh +4 -12
Dockerfile
CHANGED
|
@@ -28,7 +28,6 @@ RUN apt-get update && apt-get install -y \
|
|
| 28 |
libprotobuf-dev \
|
| 29 |
protobuf-compiler \
|
| 30 |
git \
|
| 31 |
-
ninja-build \
|
| 32 |
&& rm -rf /var/lib/apt/lists/*
|
| 33 |
|
| 34 |
# Copy root requirements and install
|
|
@@ -44,15 +43,9 @@ RUN mkdir -p id-maker/assets && \
|
|
| 44 |
wget -O id-maker/assets/TYBAH.TTF "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/TYBAH.TTF" && \
|
| 45 |
wget -O id-maker/assets/arialbd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/arialbd.ttf"
|
| 46 |
|
| 47 |
-
# Build CodeFormer extensions (basicsr)
|
| 48 |
-
WORKDIR /app/codeformer
|
| 49 |
-
RUN python basicsr/setup.py build_ext --inplace
|
| 50 |
-
|
| 51 |
# Set up storage directories and permissions
|
| 52 |
WORKDIR /app
|
| 53 |
-
RUN mkdir -p id-maker/storage/uploads id-maker/storage/processed id-maker/storage/results \
|
| 54 |
-
codeformer/static/uploads codeformer/static/results \
|
| 55 |
-
codeformer/weights codeformer/inputs codeformer/output && \
|
| 56 |
chmod -R 777 /app
|
| 57 |
|
| 58 |
# Create the startup script to run both services
|
|
|
|
| 28 |
libprotobuf-dev \
|
| 29 |
protobuf-compiler \
|
| 30 |
git \
|
|
|
|
| 31 |
&& rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
# Copy root requirements and install
|
|
|
|
| 43 |
wget -O id-maker/assets/TYBAH.TTF "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/TYBAH.TTF" && \
|
| 44 |
wget -O id-maker/assets/arialbd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/arialbd.ttf"
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Set up storage directories and permissions
|
| 47 |
WORKDIR /app
|
| 48 |
+
RUN mkdir -p id-maker/storage/uploads id-maker/storage/processed id-maker/storage/results && \
|
|
|
|
|
|
|
| 49 |
chmod -R 777 /app
|
| 50 |
|
| 51 |
# Create the startup script to run both services
|
id-maker/assets/frame-default.png
DELETED
id-maker/config/settings.json
CHANGED
|
@@ -59,5 +59,8 @@
|
|
| 59 |
60,
|
| 60 |
60
|
| 61 |
]
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
}
|
|
|
|
| 59 |
60,
|
| 60 |
60
|
| 61 |
]
|
| 62 |
+
},
|
| 63 |
+
"restoration": {
|
| 64 |
+
"fidelity": 1
|
| 65 |
}
|
| 66 |
}
|
requirements.txt
CHANGED
|
@@ -16,6 +16,7 @@ flask
|
|
| 16 |
python-multipart
|
| 17 |
jinja2
|
| 18 |
MarkupSafe
|
|
|
|
| 19 |
|
| 20 |
# Image Processing
|
| 21 |
Pillow>=10.0.0
|
|
@@ -27,16 +28,5 @@ protobuf<=3.20.3
|
|
| 27 |
scipy
|
| 28 |
scikit-image
|
| 29 |
|
| 30 |
-
# CodeFormer Utilities
|
| 31 |
-
addict
|
| 32 |
-
future
|
| 33 |
-
lmdb
|
| 34 |
-
pyyaml
|
| 35 |
-
requests
|
| 36 |
-
tqdm
|
| 37 |
-
yapf
|
| 38 |
-
lpips
|
| 39 |
-
gdown
|
| 40 |
-
|
| 41 |
# GUI (Optional for web but in id-maker reqs)
|
| 42 |
pywebview
|
|
|
|
| 16 |
python-multipart
|
| 17 |
jinja2
|
| 18 |
MarkupSafe
|
| 19 |
+
requests
|
| 20 |
|
| 21 |
# Image Processing
|
| 22 |
Pillow>=10.0.0
|
|
|
|
| 28 |
scipy
|
| 29 |
scikit-image
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
# GUI (Optional for web but in id-maker reqs)
|
| 32 |
pywebview
|
start.sh
CHANGED
|
@@ -1,17 +1,9 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
export CODEFORMER_PORT=8001
|
| 5 |
-
echo "Starting CodeFormer API on port $CODEFORMER_PORT..."
|
| 6 |
-
cd /app/codeformer && python app.py &
|
| 7 |
-
|
| 8 |
-
# 2. Wait for CodeFormer to initialize (downloads weights on first run)
|
| 9 |
-
# We give it some time, though it might take longer depending on connection.
|
| 10 |
-
sleep 5
|
| 11 |
-
|
| 12 |
-
# 3. Start ID Maker on the main HF port (7860)
|
| 13 |
export PORT=7860
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
echo "Starting ID Maker Web UI on port $PORT..."
|
| 16 |
-
echo "CodeFormer URL: $CODEFORMER_API_URL"
|
| 17 |
cd /app/id-maker && python web/server.py
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Start ID Maker on the main HF port (7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
export PORT=7860
|
| 5 |
+
# CODEFORMER_API_URL is NOT set here, so it will use the value in id-maker/config/settings.json
|
| 6 |
+
# (which points to the external HF Space)
|
| 7 |
+
|
| 8 |
echo "Starting ID Maker Web UI on port $PORT..."
|
|
|
|
| 9 |
cd /app/id-maker && python web/server.py
|