From 9a075398c35e2e1793faf222ac36b56dd6f20486 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=B6=E7=92=A8=E9=93=AD?= <12011404@mail.sustech.edu.cn>
Date: Mon, 18 Dec 2023 21:00:30 +0800
Subject: [PATCH 1/2] feat(scripts): add powershell script for windows download
---
scripts/download_models.ps1 | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 scripts/download_models.ps1
diff --git a/scripts/download_models.ps1 b/scripts/download_models.ps1
new file mode 100644
index 00000000..6839d4a6
--- /dev/null
+++ b/scripts/download_models.ps1
@@ -0,0 +1,30 @@
+# Create directory
+mkdir ".\checkpoints"
+
+# Legacy download links
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/auido2exp_00300-model.pth" -OutFile ".\checkpoints\auido2exp_00300-model.pth"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/auido2pose_00140-model.pth" -OutFile ".\checkpoints\auido2pose_00140-model.pth"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/epoch_20.pth" -OutFile ".\checkpoints\epoch_20.pth"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/facevid2vid_00189-model.pth.tar" -OutFile ".\checkpoints\facevid2vid_00189-model.pth.tar"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/shape_predictor_68_face_landmarks.dat" -OutFile ".\checkpoints\shape_predictor_68_face_landmarks.dat"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/wav2lip.pth" -OutFile ".\checkpoints\wav2lip.pth"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/mapping_00229-model.pth.tar" -OutFile ".\checkpoints\mapping_00229-model.pth.tar"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/mapping_00109-model.pth.tar" -OutFile ".\checkpoints\mapping_00109-model.pth.tar"
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/hub.zip" -OutFile ".\checkpoints\hub.zip"
+# Expand-Archive -Path ".\checkpoints\hub.zip" -DestinationPath ".\checkpoints\" -Force
+
+# Download the new links
+Invoke-WebRequest -Uri "https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2-rc/mapping_00109-model.pth.tar" -OutFile ".\checkpoints\mapping_00109-model.pth.tar"
+Invoke-WebRequest -Uri "https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2-rc/mapping_00229-model.pth.tar" -OutFile ".\checkpoints\mapping_00229-model.pth.tar"
+Invoke-WebRequest -Uri "https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2-rc/SadTalker_V0.0.2_256.safetensors" -OutFile ".\checkpoints\SadTalker_V0.0.2_256.safetensors"
+Invoke-WebRequest -Uri "https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2-rc/SadTalker_V0.0.2_512.safetensors" -OutFile ".\checkpoints\SadTalker_V0.0.2_512.safetensors"
+
+# Invoke-WebRequest -Uri "https://github.com/Winfredy/SadTalker/releases/download/v0.0.2/BFM_Fitting.zip" -OutFile ".\checkpoints\BFM_Fitting.zip"
+# Expand-Archive -Path ".\checkpoints\BFM_Fitting.zip" -DestinationPath ".\checkpoints\" -Force
+
+# Enhancer
+mkdir ".\gfpgan\weights"
+Invoke-WebRequest -Uri "https://github.com/xinntao/facexlib/releases/download/v0.1.0/alignment_WFLW_4HG.pth" -OutFile ".\gfpgan\weights\alignment_WFLW_4HG.pth"
+Invoke-WebRequest -Uri "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth" -OutFile ".\gfpgan\weights\detection_Resnet50_Final.pth"
+Invoke-WebRequest -Uri "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth" -OutFile ".\gfpgan\weights\GFPGANv1.4.pth"
+Invoke-WebRequest -Uri "https://github.com/xinntao/facexlib/releases/download/v0.2.2/parsing_parsenet.pth" -OutFile ".\gfpgan\weights\parsing_parsenet.pth"
From 799434c209dfd90bc73b82dafb3b1cb9aaa0155b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=B6=E7=92=A8=E9=93=AD?= <12011404@mail.sustech.edu.cn>
Date: Mon, 18 Dec 2023 21:03:38 +0800
Subject: [PATCH 2/2] feat(app_sadtalker): upgrade to gradio 4. tested with
4.10.0
---
app_sadtalker.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/app_sadtalker.py b/app_sadtalker.py
index 1401a600..8b3c5edc 100644
--- a/app_sadtalker.py
+++ b/app_sadtalker.py
@@ -32,17 +32,20 @@ def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warp
Homepage \
Github ")
- with gr.Row().style(equal_height=False):
+ with gr.Row(equal_height=False):
with gr.Column(variant='panel'):
with gr.Tabs(elem_id="sadtalker_source_image"):
with gr.TabItem('Upload image'):
with gr.Row():
- source_image = gr.Image(label="Source image", source="upload", type="filepath", elem_id="img2img_image").style(width=512)
+ source_image = gr.Image(label="Source image",
+ type="filepath",
+ elem_id="img2img_image", width=512)
with gr.Tabs(elem_id="sadtalker_driven_audio"):
with gr.TabItem('Upload OR TTS'):
with gr.Column(variant='panel'):
- driven_audio = gr.Audio(label="Input audio", source="upload", type="filepath")
+ driven_audio = gr.Audio(label="Input audio",
+ type="filepath")
if sys.platform != 'win32' and not in_webui:
from src.utils.text2speech import TTSTalker