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

Add links in README for downloading more pre-trained models, fix for 'Row' object has no attribute 'style' #960

Open
wants to merge 2 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
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
## Changelog

The previous changelog can be found [here](docs/changlelog.md).
- __[2024.09.26]__: Fix 1 for Error: with gr.Row().style(equal_height=False): AttributeError: 'Row' object has no attribute 'style'

- __[2024.09.26]__: Fix 2 Add links for downloading more pretrained model, auido2pose_00140-model.pth and etc for REF

- __[2023.06.12]__: Added more new features in WebUI extension, see the discussion [here](https://github.com/OpenTalker/SadTalker/discussions/386).

Expand Down Expand Up @@ -145,6 +148,35 @@ We also provide an offline patch (`gfpgan/`), so no model will be downloaded whe
* [GitHub Releases](https://github.com/OpenTalker/SadTalker/releases)
* [Baidu (百度云盘)](https://pan.baidu.com/s/1kb1BCPaLOWX1JJb9Czbn6w?pwd=sadt) (Password: `sadt`)

[202409] Fix details:
Fix 1:
Error: with gr.Row().style(equal_height=False): AttributeError: 'Row' object has no attribute 'style'
REF: https://github.com/OpenTalker/SadTalker/issues/949
app_sadtalker.zip Download this patch, and few extra fixes needed with gr.Audio, gr.Video

Fix 2:
No such file or directory: 'checkpoints\\auido2pose_00140-model.pth'
REF: https://github.com/Zz-ww/SadTalker-Video-Lip-Sync
Download auido2pose_00140-model.pth and etc:
百度网盘 https://pan.baidu.com/s/15-zjk64SGQnRT9qIduTe2A 提取码:klfv
Google drive:https://drive.google.com/file/d/1lW4mf5YNtS4MAD7ZkAauDDWp2N3_Qzs7/view?usp=sharing
夸克网盘:https://pan.quark.cn/s/2a1042b1d046 提取码:zMBP
├──checkpoints
| ├──BFM_Fitting
| ├──DAIN_weight
| ├──hub
| ├──auido2exp_00300-model.pth
| ├──auido2pose_00140-model.pth
| ├──epoch_20.pth
| ├──facevid2vid_00189-model.pth.tar
| ├──GFPGANv1.3.pth
| ├──GPEN-BFR-512.pth
| ├──mapping_00109-model.pth.tar
| ├──ParseNet-latest.pth
| ├──RetinaFace-R50.pth
| ├──shape_predictor_68_face_landmarks.dat
| ├──wav2lip.pth

<!-- TODO add Hugging Face links -->

### GFPGAN Offline Patch
Expand Down
32 changes: 27 additions & 5 deletions app_sadtalker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,38 @@ def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warp
<a style='font-size:18px;color: #efefef' href='https://sadtalker.github.io'>Homepage</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<a style='font-size:18px;color: #efefef' href='https://github.com/Winfredy/SadTalker'> Github </div>")

with gr.Row().style(equal_height=False):
submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary') # Define the submit button here

driven_audio = gr.Audio(label="Input audio", type="filepath", elem_id="driven_audio") # Define the driven_audio variable here

preprocess_type = gr.Radio(['crop', 'resize','full', 'extcrop', 'extfull'], value='crop', label='preprocess', info="How to handle input image?") # Define the preprocess_type variable here

is_still_mode = gr.Checkbox(label="Still Mode (fewer head motion, works with preprocess `full`)", elem_id="is_still_mode") # Define the is_still_mode variable here

enhancer = gr.Checkbox(label="GFPGAN as Face enhancer", elem_id="enhancer") # Define the enhancer variable here

batch_size = gr.Slider(label="batch size in generation", step=1, maximum=10, value=2, elem_id="batch_size") # Define the batch_size variable here

size_of_image = gr.Radio([256, 512], value=256, label='face model resolution', info="use 256/512 model?", elem_id="size_of_image") # Define the size_of_image variable here

pose_style = gr.Slider(minimum=0, maximum=46, step=1, label="Pose style", value=0, elem_id="pose_style") # Define the pose_style variable here

gen_video = gr.Video(label="Generated video", format="mp4", elem_id="gen_video") # Define the gen_video variable here

#with gr.Row().style(equal_height=False):
with gr.Row():
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", source="upload", type="filepath", elem_id="img2img_image").style(width=512)
source_image = gr.Image(label="Source image", type="filepath", elem_id="img2img_image")

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", source="upload", type="filepath")
driven_audio = gr.Audio(label="Input audio", type="filepath", elem_id="driven_audio")

if sys.platform != 'win32' and not in_webui:
from src.utils.text2speech import TTSTalker
Expand All @@ -68,7 +89,8 @@ def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warp
submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary')

with gr.Tabs(elem_id="sadtalker_genearted"):
gen_video = gr.Video(label="Generated video", format="mp4").style(width=256)
# gen_video = gr.Video(label="Generated video", format="mp4").style(width=256)
gen_video = gr.Video(label="Generated video", format="mp4")

if warpfn:
submit.click(
Expand Down