Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Updated ] Added bat file for windows user #102

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ We are very troubled by the fact that GHOST can be used for unethical and disrep
<img src="/examples/videos/mark.webp" width="360"/>
<div/>

## Installation
## Installation
Python version 3.8

1. Clone this repository
```bash
Expand All @@ -60,6 +61,10 @@ We are very troubled by the fact that GHOST can be used for unethical and disrep
```bash
sh download_models.sh
```
if windows user here is how to download the weights
```bash
download_models.bat
```
## Usage
1. Colab Demo <a href="https://colab.research.google.com/drive/1B-2JoRxZZwrY2eK_E7TB5VYcae3EjQ1f"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a> or you can use jupyter notebook [SberSwapInference.ipynb](SberSwapInference.ipynb) locally
2. Face Swap On Video
Expand Down
29 changes: 29 additions & 0 deletions download_models.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:: Create necessary directories if they don't exist
mkdir arcface_model
mkdir insightface_func\models\antelope
mkdir weights
mkdir AdaptiveWingLoss\AWL_detector
:: Load arcface
curl -L -o ./arcface_model/backbone.pth https://github.com/sberbank-ai/sber-swap/releases/download/arcface/backbone.pth
curl -L -o ./arcface_model/iresnet.py https://github.com/sberbank-ai/sber-swap/releases/download/arcface/iresnet.py

:: Load landmarks detector
curl -L -o ./insightface_func/models/antelope/glintr100.onnx https://github.com/sberbank-ai/sber-swap/releases/download/antelope/glintr100.onnx
curl -L -o ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx https://github.com/sberbank-ai/sber-swap/releases/download/antelope/scrfd_10g_bnkps.onnx

:: Load G and D models with 1, 2, 3 blocks
:: Model with 2 blocks is main
curl -L -o ./weights/G_unet_2blocks.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/G_unet_2blocks.pth
curl -L -o ./weights/D_unet_2blocks.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/D_unet_2blocks.pth

curl -L -o ./weights/G_unet_1block.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/G_unet_1block.pth
curl -L -o ./weights/D_unet_1block.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/D_unet_1block.pth

curl -L -o ./weights/G_unet_3blocks.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/G_unet_3blocks.pth
curl -L -o ./weights/D_unet_3blocks.pth https://github.com/sberbank-ai/sber-swap/releases/download/sber-swap-v2.0/D_unet_3blocks.pth

:: Load model for eyes loss
curl -L -o ./AdaptiveWingLoss/AWL_detector/WFLW_4HG.pth https://github.com/sberbank-ai/sber-swap/releases/download/awl_detector/WFLW_4HG.pth

:: Load super res model
curl -L -o ./weights/10_net_G.pth https://github.com/sberbank-ai/sber-swap/releases/download/super-res/10_net_G.pth
Binary file added requirement.txt
Binary file not shown.