From 8fde7237aacf8604767e9e3af63149740f9c2614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=E1=BA=A1=20Tu=E1=BA=A5n=20Anh?= <69012511+tripleseven190504@users.noreply.github.com> Date: Tue, 6 Feb 2024 00:19:32 +0700 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab04ff8..da298c7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ ## Chạy trên local -``` bash +### Linux + +```bash cd ~ pip install --upgrade pip git clone https://github.com/tripleseven190504/change-face.git @@ -21,7 +23,36 @@ pip install torch torchvision torchaudio --force-reinstall --index-url https://d pip install onnxruntime-gpu==1.15.1 ``` -``` bash +```bash cd ~/change-face python run.py -s ~/face.jpeg -t ~/video.mp4 -o ~/new_video.mp4 --frame-processor face_swapper ``` + +### Windows + +Download [Cuda](https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe) + +```batch +@echo off +cd %USERPROFILE%\Desktop +winget install -e --id Git.Git +winget install -e --id Gyan.FFmpeg +winget install -e --id Microsoft.VCRedist.2015+.x64 +winget install -e --id Microsoft.VisualStudio.2022.BuildTools --override "--wait --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended" +pip install --upgrade pip +git clone https://github.com/tripleseven190504/change-face.git +pip install fastapi kaleido python-multipart uvicorn +pip install --force-reinstall lida gcsfs google-colab huggingface-hub imageio tensorflow tensorflow-probability torchdata torchtext yfinance +pip install -r %USERPROFILE%\Desktop\change-face\requirements.txt +wget https://huggingface.co/ezioruan/inswapper_128.onnx/resolve/main/inswapper_128.onnx -O inswapper_128.onnx +mkdir %USERPROFILE%\Desktop\change-face\models +move inswapper_128.onnx %USERPROFILE%\Desktop\change-face\models +pip uninstall onnxruntime onnxruntime-gpu -y +pip install torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/cu118 +pip install onnxruntime-gpu==1.15.1 + +``` +```batch +cd %USERPROFILE%\Desktop\change-face\ +python run.py -s %USERPROFILE%\Desktop\change-face\face.jpg -t %USERPROFILE%\Desktop\change-face\video.mp4 -o %USERPROFILE%\Desktop\change-face\new_video.mp4 --frame-processor face_swapper +```