adfly450 commited on
Commit
59f79c6
1 Parent(s): 33f8eee

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile.nvidia +20 -0
  2. run.sh +13 -0
Dockerfile.nvidia ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
2
+
3
+ # Always use UTC on a server
4
+ RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
5
+
6
+ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y python3 python3-pip python3-tk git ffmpeg nvidia-cuda-toolkit nvidia-container-runtime libnvidia-decode-525-server wget unzip
7
+ RUN wget https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip -O /tmp/buffalo_l.zip && \
8
+ mkdir -p /root/.insightface/models/buffalo_l && \
9
+ cd /root/.insightface/models/buffalo_l && \
10
+ unzip /tmp/buffalo_l.zip && \
11
+ rm -f /tmp/buffalo_l.zip
12
+
13
+ RUN pip install nvidia-tensorrt
14
+ RUN git clone https://github.com/xaviviro/refacer && cd refacer && pip install -r requirements-GPU.txt
15
+
16
+ WORKDIR /refacer
17
+
18
+ # Test following commands in container to make sure GPU stuff works
19
+ # nvidia-smi
20
+ # python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
run.sh ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Run this script from within the refacer/docker folder.
3
+ # You'll need inswrapper_128.onnx from either:
4
+ # https://drive.google.com/file/d/1eu60OrRtn4WhKrzM4mQv4F3rIuyUXqfl/view?usp=drive_link
5
+ # or https://drive.google.com/file/d/1jbDUGrADco9A1MutWjO6d_1dwizh9w9P/view?usp=sharing
6
+ # or https://mega.nz/file/9l8mGDJA#FnPxHwpdhDovDo6OvbQjhHd2nDAk8_iVEgo3mpHLG6U
7
+ # or https://1drv.ms/u/s!AsHA3Xbnj6uAgxhb_tmQ7egHACOR?e=CPoThO
8
+ # or https://civitai.com/models/80324?modelVersionId=85159
9
+
10
+ docker stop -t 0 refacer
11
+ docker build -t refacer -f Dockerfile.nvidia . && \
12
+ docker run --rm --name refacer -v $(pwd)/..:/refacer -p 7860:7860 --gpus all refacer python3 app.py --server_name 0.0.0.0 &
13
+ sleep 2 && google-chrome --new-window "http://127.0.0.1:7860" &