Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.jpg
**/*.png
**/*.mp4
**/*.wav
weights/D_unet_*.pth
.idea
.git
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM pytorch/pytorch:1.7.1-cuda11.0-cudnn8-runtime

# Install dependencies
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libgl1-mesa-glx

WORKDIR /ghost
COPY . .

RUN pip3 install --upgrade pip setuptools wheel && pip3 install -r requirements-docker.txt

ENTRYPOINT ["python", "inference.py"]
4 changes: 3 additions & 1 deletion inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def init_models(args):
netArc.eval()

# model to get face landmarks
handler = Handler('./coordinate_reg/model/2d106det', 0, ctx_id=0, det_size=640)
handler = Handler('./coordinate_reg/model/2d106det', 0, ctx_id=-1, det_size=640) # -1 for cpu

# model to make superres of face, set use_sr=True if you want to use super resolution or use_sr=False if you don't
if args.use_sr:
Expand All @@ -53,6 +53,7 @@ def init_models(args):


def main(args):
print('Init models...')
app, G, netArc, handler, model = init_models(args)

# get crops from source images
Expand Down Expand Up @@ -125,6 +126,7 @@ def main(args):


if __name__ == "__main__":
print('Init parser...')
parser = argparse.ArgumentParser()

# Generator params
Expand Down
11 changes: 11 additions & 0 deletions requirements-docker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
opencv-python
onnx==1.9.0
onnxruntime==1.4.0
numpy<=1.20
mxnet
scikit-image
insightface==0.2.1
requests==2.25.1
kornia==0.5.4
dill
protobuf<=3.20