vadim71 commited on
Commit
c157490
·
verified ·
1 Parent(s): 3154e32

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -7
Dockerfile CHANGED
@@ -19,13 +19,38 @@ RUN pip install --upgrade pip && pip install -r /app/requirements-full.txt
19
 
20
  COPY . /app
21
 
22
- # Copy InsightFace model pack (buffalo_l) to the default insightface cache dir
23
- RUN mkdir -p /root/.insightface/models/buffalo_l && \
24
- cp -r /app/models/buffalo_l/* /root/.insightface/models/buffalo_l/
25
-
26
- # Hard checks for offline-critical files
27
- RUN test -f /app/models/inswapper_128.onnx && \
28
- test -f /app/models/GFPGANv1.3.pth && \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  test -f /root/.insightface/models/buffalo_l/w600k_r50.onnx && \
30
  test -f /root/.insightface/models/buffalo_l/det_10g.onnx
31
 
 
19
 
20
  COPY . /app
21
 
22
+ RUN python - << 'PY'
23
+ import os, shutil
24
+ from huggingface_hub import snapshot_download
25
+
26
+ repo_id = "vadim71/faceswap-models"
27
+ print("[INFO] Downloading InsightFace buffalo_l files from dataset:", repo_id)
28
+
29
+ local_dir = "/tmp/buffalo_l_download"
30
+ needed = ["1k3d68.onnx","2d106det.onnx","det_10g.onnx","genderage.onnx","w600k_r50.onnx"]
31
+
32
+ snapshot_download(
33
+ repo_id=repo_id,
34
+ repo_type="dataset",
35
+ allow_patterns=needed,
36
+ local_dir=local_dir,
37
+ local_dir_use_symlinks=False,
38
+ )
39
+
40
+ dst = "/root/.insightface/models/buffalo_l"
41
+ os.makedirs(dst, exist_ok=True)
42
+
43
+ for f in needed:
44
+ p = os.path.join(local_dir, f)
45
+ if not os.path.exists(p):
46
+ raise RuntimeError(f"Missing in dataset root: {f}")
47
+ shutil.copy2(p, os.path.join(dst, f))
48
+
49
+ print("[OK] buffalo_l copied to", dst)
50
+ PY
51
+
52
+ RUN test -f /app/inswapper_128.onnx && \
53
+ test -f /app/GFPGANv1.3.pth && \
54
  test -f /root/.insightface/models/buffalo_l/w600k_r50.onnx && \
55
  test -f /root/.insightface/models/buffalo_l/det_10g.onnx
56