ashishninehertz commited on
Commit
b0a6718
·
1 Parent(s): c95d7ac
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +21 -1
  2. .gitignore +159 -0
  3. Dockerfile +59 -0
  4. LICENSE +21 -0
  5. README.md +8 -7
  6. app.py +341 -0
  7. examples/driven_audio/RD_Radio31_000.wav +3 -0
  8. examples/driven_audio/RD_Radio34_002.wav +3 -0
  9. examples/driven_audio/RD_Radio36_000.wav +3 -0
  10. examples/driven_audio/RD_Radio40_000.wav +3 -0
  11. examples/driven_audio/bus_chinese.wav +3 -0
  12. examples/driven_audio/chinese_news.wav +3 -0
  13. examples/driven_audio/chinese_poem1.wav +3 -0
  14. examples/driven_audio/chinese_poem2.wav +3 -0
  15. examples/driven_audio/deyu.wav +3 -0
  16. examples/driven_audio/eluosi.wav +3 -0
  17. examples/driven_audio/fayu.wav +3 -0
  18. examples/driven_audio/imagine.wav +3 -0
  19. examples/driven_audio/itosinger1.wav +3 -0
  20. examples/driven_audio/japanese.wav +3 -0
  21. examples/source_image/art_0.png +3 -0
  22. examples/source_image/art_1.png +3 -0
  23. examples/source_image/art_10.png +3 -0
  24. examples/source_image/art_11.png +3 -0
  25. examples/source_image/art_12.png +3 -0
  26. examples/source_image/art_13.png +3 -0
  27. examples/source_image/art_14.png +3 -0
  28. examples/source_image/art_15.png +3 -0
  29. examples/source_image/art_16.png +3 -0
  30. examples/source_image/art_17.png +3 -0
  31. examples/source_image/art_18.png +3 -0
  32. examples/source_image/art_19.png +3 -0
  33. examples/source_image/art_2.png +3 -0
  34. examples/source_image/art_20.png +3 -0
  35. examples/source_image/art_3.png +3 -0
  36. examples/source_image/art_4.png +3 -0
  37. examples/source_image/art_5.png +3 -0
  38. examples/source_image/art_6.png +3 -0
  39. examples/source_image/art_7.png +3 -0
  40. examples/source_image/art_8.png +3 -0
  41. examples/source_image/art_9.png +3 -0
  42. examples/source_image/full3.png +3 -0
  43. examples/source_image/full4.jpeg +0 -0
  44. examples/source_image/full_body_1.png +3 -0
  45. examples/source_image/full_body_2.png +3 -0
  46. examples/source_image/happy.png +3 -0
  47. examples/source_image/happy1.png +3 -0
  48. examples/source_image/people_0.png +3 -0
  49. examples/source_image/sad.png +3 -0
  50. examples/source_image/sad1.png +3 -0
.gitattributes CHANGED
@@ -25,7 +25,6 @@
25
  *.safetensors filter=lfs diff=lfs merge=lfs -text
26
  saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
  *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
  *.tgz filter=lfs diff=lfs merge=lfs -text
31
  *.wasm filter=lfs diff=lfs merge=lfs -text
@@ -33,3 +32,24 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  *.safetensors filter=lfs diff=lfs merge=lfs -text
26
  saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
  *.tar.* filter=lfs diff=lfs merge=lfs -text
 
28
  *.tflite filter=lfs diff=lfs merge=lfs -text
29
  *.tgz filter=lfs diff=lfs merge=lfs -text
30
  *.wasm filter=lfs diff=lfs merge=lfs -text
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ checkpoints/BFM_Fitting/01_MorphableModel.mat filter=lfs diff=lfs merge=lfs -text
36
+ checkpoints/BFM_Fitting/BFM09_model_info.mat filter=lfs diff=lfs merge=lfs -text
37
+ checkpoints/facevid2vid_00189-model.pth.tar filter=lfs diff=lfs merge=lfs -text
38
+ checkpoints/mapping_00229-model.pth.tar filter=lfs diff=lfs merge=lfs -text
39
+ checkpoints/shape_predictor_68_face_landmarks.dat filter=lfs diff=lfs merge=lfs -text
40
+ examples/driven_audio/chinese_news.wav filter=lfs diff=lfs merge=lfs -text
41
+ examples/driven_audio/deyu.wav filter=lfs diff=lfs merge=lfs -text
42
+ examples/driven_audio/eluosi.wav filter=lfs diff=lfs merge=lfs -text
43
+ examples/driven_audio/fayu.wav filter=lfs diff=lfs merge=lfs -text
44
+ examples/driven_audio/imagine.wav filter=lfs diff=lfs merge=lfs -text
45
+ examples/driven_audio/japanese.wav filter=lfs diff=lfs merge=lfs -text
46
+ examples/source_image/art_16.png filter=lfs diff=lfs merge=lfs -text
47
+ examples/source_image/art_17.png filter=lfs diff=lfs merge=lfs -text
48
+ examples/source_image/art_3.png filter=lfs diff=lfs merge=lfs -text
49
+ examples/source_image/art_4.png filter=lfs diff=lfs merge=lfs -text
50
+ examples/source_image/art_5.png filter=lfs diff=lfs merge=lfs -text
51
+ examples/source_image/art_8.png filter=lfs diff=lfs merge=lfs -text
52
+ examples/source_image/art_9.png filter=lfs diff=lfs merge=lfs -text
53
+ *.png filter=lfs diff=lfs merge=lfs -text
54
+ *.wav filter=lfs diff=lfs merge=lfs -text
55
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ results/
156
+ checkpoints/
157
+ gradio_cached_examples/
158
+ gfpgan/
159
+ start.sh
Dockerfile ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ RUN apt-get update && \
4
+ apt-get upgrade -y && \
5
+ apt-get install -y --no-install-recommends \
6
+ git \
7
+ zip \
8
+ unzip \
9
+ git-lfs \
10
+ wget \
11
+ curl \
12
+ # ffmpeg \
13
+ ffmpeg \
14
+ x264 \
15
+ # python build dependencies \
16
+ build-essential \
17
+ libssl-dev \
18
+ zlib1g-dev \
19
+ libbz2-dev \
20
+ libreadline-dev \
21
+ libsqlite3-dev \
22
+ libncursesw5-dev \
23
+ xz-utils \
24
+ tk-dev \
25
+ libxml2-dev \
26
+ libxmlsec1-dev \
27
+ libffi-dev \
28
+ liblzma-dev && \
29
+ apt-get clean && \
30
+ rm -rf /var/lib/apt/lists/*
31
+
32
+ RUN useradd -m -u 1000 user
33
+ USER user
34
+ ENV HOME=/home/user \
35
+ PATH=/home/user/.local/bin:${PATH}
36
+ WORKDIR ${HOME}/app
37
+
38
+ RUN curl https://pyenv.run | bash
39
+ ENV PATH=${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:${PATH}
40
+ ENV PYTHON_VERSION=3.10.9
41
+ RUN pyenv install ${PYTHON_VERSION} && \
42
+ pyenv global ${PYTHON_VERSION} && \
43
+ pyenv rehash && \
44
+ pip install --no-cache-dir -U pip setuptools wheel
45
+
46
+ RUN pip install --no-cache-dir -U torch==1.12.1 torchvision==0.13.1
47
+ COPY --chown=1000 requirements.txt /tmp/requirements.txt
48
+ RUN pip install --no-cache-dir -U -r /tmp/requirements.txt
49
+
50
+ COPY --chown=1000 . ${HOME}/app
51
+ RUN ls -a
52
+ ENV PYTHONPATH=${HOME}/app \
53
+ PYTHONUNBUFFERED=1 \
54
+ GRADIO_ALLOW_FLAGGING=never \
55
+ GRADIO_NUM_PORTS=1 \
56
+ GRADIO_SERVER_NAME=0.0.0.0 \
57
+ GRADIO_THEME=huggingface \
58
+ SYSTEM=spaces
59
+ CMD ["python", "app.py"]
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Tencent AI Lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,13 +1,14 @@
1
  ---
2
- title: Ninehertz Ai Head
3
- emoji: 🐢
4
- colorFrom: blue
5
- colorTo: pink
6
  sdk: gradio
7
- sdk_version: 5.29.1
8
  app_file: app.py
9
  pinned: false
10
- license: unknown
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: ninehertzaihead
3
+ emoji: 😎
4
+ colorFrom: purple
5
+ colorTo: green
6
  sdk: gradio
7
+ sdk_version: 3.50.2
8
  app_file: app.py
9
  pinned: false
10
+ license: mit
11
  ---
12
 
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os, sys
2
+ import tempfile
3
+ import gradio as gr
4
+ from src.gradio_demo import SadTalker
5
+ from huggingface_hub import snapshot_download
6
+
7
+ def get_source_image(image):
8
+ return image
9
+
10
+ try:
11
+ import webui
12
+ in_webui = True
13
+ except:
14
+ in_webui = False
15
+
16
+ def toggle_audio_file(choice):
17
+ if choice == False:
18
+ return gr.update(visible=True), gr.update(visible=False)
19
+ else:
20
+ return gr.update(visible=False), gr.update(visible=True)
21
+
22
+ def ref_video_fn(path_of_ref_video):
23
+ if path_of_ref_video is not None:
24
+ return gr.update(value=True)
25
+ else:
26
+ return gr.update(value=False)
27
+
28
+ def download_model():
29
+ REPO_ID = 'ashishninehertz/modelforfacetalk'
30
+ snapshot_download(repo_id=REPO_ID, local_dir='./checkpoints', local_dir_use_symlinks=True)
31
+
32
+ def animatalk_demo():
33
+ download_model()
34
+ animatalker = SadTalker(lazy_load=True)
35
+
36
+ custom_theme = gr.themes.Default(
37
+ primary_hue="blue",
38
+ secondary_hue="teal",
39
+ neutral_hue="slate",
40
+ radius_size="md",
41
+ font=[gr.themes.GoogleFont("Poppins"), "ui-sans-serif", "system-ui", "sans-serif"],
42
+ ).set(
43
+ button_primary_background_fill="linear-gradient(90deg, #2563eb 0%, #7c3aed 100%)",
44
+ button_primary_background_fill_hover="linear-gradient(90deg, #1d4ed8 0%, #6d28d9 100%)",
45
+ button_primary_text_color="white",
46
+ button_primary_background_fill_dark="linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%)",
47
+ )
48
+
49
+ with gr.Blocks(theme=custom_theme, analytics_enabled=False) as animatalk_interface:
50
+ gr.HTML("""
51
+ <div style="text-align: center; margin-bottom: 20px;">
52
+ <h1 style="font-size: 2.5rem; margin-bottom: 10px; background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: fadeIn 2s;">
53
+ AnimaTalk: AI-Powered Talking Face Animation
54
+ </h1>
55
+ <p style="font-size: 1.1rem; color: #6b7280;">
56
+ Bring your images to life with realistic facials animations
57
+ </p>
58
+ </div>
59
+ <style>
60
+ @keyframes fadeIn {
61
+ from { opacity: 0; }
62
+ to { opacity: 1; }
63
+ }
64
+ .gradient-border {
65
+ border: 3px solid;
66
+ border-image: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%) 1;
67
+ animation: borderPulse 4s infinite;
68
+ }
69
+ @keyframes borderPulse {
70
+ 0% { border-image: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%) 1; }
71
+ 50% { border-image: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%) 1; }
72
+ 100% { border-image: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%) 1; }
73
+ }
74
+ </style>
75
+ """)
76
+
77
+ with gr.Row():
78
+ with gr.Column(variant='panel', min_width=500):
79
+ with gr.Tabs():
80
+ with gr.TabItem('Source Image', id="source_image"):
81
+ source_image = gr.Image(
82
+ label="Upload your image",
83
+ source="upload",
84
+ type="filepath",
85
+ elem_id="source_img",
86
+ interactive=True
87
+ )
88
+
89
+ with gr.Tabs():
90
+ # with gr.TabItem('Animation Settings', id="driven_audio"):
91
+ # gr.Markdown("""
92
+ # <div style="background: #f8fafc; padding: 15px; border-radius: 8px; margin-bottom: 15px;">
93
+ # <b>Animation Options:</b><br>
94
+ # 1. Audio only<br>
95
+ # 2. Audio + Reference Video<br>
96
+ # 3. Idle animation only<br>
97
+ # 4. Reference video only
98
+ # </div>
99
+ # """)
100
+
101
+ with gr.Row():
102
+ driven_audio = gr.Audio(
103
+ label="Upload audio file",
104
+ source="upload",
105
+ type="filepath",
106
+ max_length=180,
107
+ visible=True
108
+ )
109
+ driven_audio_no = gr.Audio(
110
+ label="No audio needed for idle mode",
111
+ source="upload",
112
+ type="filepath",
113
+ visible=False
114
+ )
115
+
116
+ with gr.Column():
117
+ use_idle_mode = gr.Checkbox(
118
+ label="Enable Idle Animation",
119
+ info="Generate animation without audio"
120
+ )
121
+ length_of_audio = gr.Number(
122
+ value=5,
123
+ label="Video length (seconds)",
124
+ precision=0
125
+ )
126
+ use_idle_mode.change(
127
+ toggle_audio_file,
128
+ inputs=use_idle_mode,
129
+ outputs=[driven_audio, driven_audio_no]
130
+ )
131
+
132
+ with gr.Row():
133
+ ref_video = gr.Video(
134
+ label="Reference Video (optional)",
135
+ source="upload",
136
+ type="filepath",
137
+ interactive=True
138
+ )
139
+
140
+ with gr.Column():
141
+ use_ref_video = gr.Checkbox(
142
+ label="Use Reference Video",
143
+ value=False
144
+ )
145
+ ref_info = gr.Radio(
146
+ ['pose', 'blink', 'pose+blink', 'all'],
147
+ value='pose',
148
+ label='Reference Style',
149
+ info="Select which aspects to copy from reference"
150
+ )
151
+ ref_video.change(
152
+ ref_video_fn,
153
+ inputs=ref_video,
154
+ outputs=[use_ref_video]
155
+ )
156
+
157
+ with gr.Column(variant='panel'):
158
+ with gr.Tabs():
159
+ with gr.TabItem('Generation Settings'):
160
+ with gr.Column(variant='panel'):
161
+ with gr.Row():
162
+ pose_style = gr.Slider(
163
+ minimum=0,
164
+ maximum=45,
165
+ step=1,
166
+ label="Pose Style Intensity",
167
+ value=0
168
+ )
169
+ exp_weight = gr.Slider(
170
+ minimum=0,
171
+ maximum=3,
172
+ step=0.1,
173
+ label="Expression Strength",
174
+ value=1
175
+ )
176
+ blink_every = gr.Checkbox(
177
+ label="Enable Eye Blinking",
178
+ value=True
179
+ )
180
+
181
+ with gr.Row():
182
+ size_of_image = gr.Radio(
183
+ [256, 512],
184
+ value=256,
185
+ label='Face Resolution',
186
+ info="Higher resolution needs more processing power"
187
+ )
188
+ preprocess_type = gr.Radio(
189
+ ['crop', 'resize', 'full', 'extcrop', 'extfull'],
190
+ value='crop',
191
+ label='Image Processing',
192
+ info="How to handle the input image"
193
+ )
194
+
195
+ with gr.Row():
196
+ is_still_mode = gr.Checkbox(
197
+ label="Still Mode",
198
+ info="Reduces head movement for more stable results"
199
+ )
200
+ facerender = gr.Radio(
201
+ ['facevid2vid', 'pirender'],
202
+ value='facevid2vid',
203
+ label='Rendering Engine'
204
+ )
205
+
206
+ with gr.Row():
207
+ batch_size = gr.Slider(
208
+ label="Generation Batch Size",
209
+ step=1,
210
+ maximum=10,
211
+ value=1,
212
+ info="Higher values process more at once"
213
+ )
214
+ enhancer = gr.Checkbox(
215
+ label="Enable Face Enhancer",
216
+ info="Improves face quality with GFPGAN"
217
+ )
218
+
219
+ submit = gr.Button(
220
+ 'Generate Animation',
221
+ variant='primary',
222
+ elem_classes="gradient-border"
223
+ )
224
+
225
+ with gr.Tabs():
226
+ gen_video = gr.Video(
227
+ label="Generated Animation",
228
+ format="mp4",
229
+ autoplay=True,
230
+ elem_id="output_video"
231
+ )
232
+
233
+ submit.click(
234
+ fn=animatalker.test,
235
+ inputs=[
236
+ source_image,
237
+ driven_audio,
238
+ preprocess_type,
239
+ is_still_mode,
240
+ enhancer,
241
+ batch_size,
242
+ size_of_image,
243
+ pose_style,
244
+ facerender,
245
+ exp_weight,
246
+ use_ref_video,
247
+ ref_video,
248
+ ref_info,
249
+ use_idle_mode,
250
+ length_of_audio,
251
+ blink_every
252
+ ],
253
+ outputs=[gen_video],
254
+ )
255
+
256
+ # with gr.Row():
257
+ # examples = [
258
+ # [
259
+ # 'examples/source_image/full_body_1.png',
260
+ # 'examples/driven_audio/bus_chinese.wav',
261
+ # 'crop',
262
+ # True,
263
+ # False
264
+ # ],
265
+ # [
266
+ # 'examples/source_image/full_body_2.png',
267
+ # 'examples/driven_audio/japanese.wav',
268
+ # 'crop',
269
+ # False,
270
+ # False
271
+ # ],
272
+ # [
273
+ # 'examples/source_image/full3.png',
274
+ # 'examples/driven_audio/deyu.wav',
275
+ # 'crop',
276
+ # False,
277
+ # True
278
+ # ],
279
+ # [
280
+ # 'examples/source_image/full4.jpeg',
281
+ # 'examples/driven_audio/eluosi.wav',
282
+ # 'full',
283
+ # False,
284
+ # True
285
+ # ],
286
+ # [
287
+ # 'examples/source_image/full4.jpeg',
288
+ # 'examples/driven_audio/imagine.wav',
289
+ # 'full',
290
+ # True,
291
+ # True
292
+ # ],
293
+ # [
294
+ # 'examples/source_image/full_body_1.png',
295
+ # 'examples/driven_audio/bus_chinese.wav',
296
+ # 'full',
297
+ # True,
298
+ # False
299
+ # ],
300
+ # [
301
+ # 'examples/source_image/art_13.png',
302
+ # 'examples/driven_audio/fayu.wav',
303
+ # 'resize',
304
+ # True,
305
+ # False
306
+ # ],
307
+ # [
308
+ # 'examples/source_image/art_5.png',
309
+ # 'examples/driven_audio/chinese_news.wav',
310
+ # 'resize',
311
+ # False,
312
+ # False
313
+ # ],
314
+ # [
315
+ # 'examples/source_image/art_5.png',
316
+ # 'examples/driven_audio/RD_Radio31_000.wav',
317
+ # 'resize',
318
+ # True,
319
+ # True
320
+ # ],
321
+ # ]
322
+ # gr.Examples(
323
+ # examples=examples,
324
+ # inputs=[
325
+ # source_image,
326
+ # driven_audio,
327
+ # preprocess_type,
328
+ # is_still_mode,
329
+ # enhancer
330
+ # ],
331
+ # outputs=[gen_video],
332
+ # fn=animatalker.test,
333
+ # cache_examples=os.getenv('SYSTEM') == 'spaces'
334
+ # )
335
+
336
+ return animatalk_interface
337
+
338
+ if __name__ == "__main__":
339
+ demo = animatalk_demo()
340
+ demo.queue(max_size=10, api_open=True)
341
+ demo.launch(debug=True)
examples/driven_audio/RD_Radio31_000.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2c9ccb3fd22f5bea782a2cd8ac6b60c4e8eb68b18a2eeeaa843b2bfb3c3dfbd
3
+ size 512044
examples/driven_audio/RD_Radio34_002.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57a0bfd5715cfde2a8e2effe3c776dbcb8e3a22aa872b5b682f00dc38780a631
3
+ size 512044
examples/driven_audio/RD_Radio36_000.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3ab7eb00789418f29c25ae8abd00cf9c99f809a707311a6624d102b569cc13f
3
+ size 512044
examples/driven_audio/RD_Radio40_000.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7469ca98f84a258decc5e4bc680f388f92d82a7da373c115ec3f452ca54c44e0
3
+ size 512044
examples/driven_audio/bus_chinese.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6766dd6d56c019e2c30119b5a5a54b272adee22c5dddd163477065ea848a296b
3
+ size 652276
examples/driven_audio/chinese_news.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b0f4d313a1ca671bc4831d60bcf0c12225efbffe6c0e93e54fbfe9bcd4021cb
3
+ size 1536078
examples/driven_audio/chinese_poem1.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f5488160b96cea9463582d86ec0b7a04fd83083f8448a8a9e5383dcdfb7578e
3
+ size 262734
examples/driven_audio/chinese_poem2.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7eddce7d3a0679d81d370ff3cfb7de9929f47fa92a1eec1cb9af6a030c353c29
3
+ size 460878
examples/driven_audio/deyu.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba1839c57770a2ab0b593ce814344bfd4d750da02acc9be9e8cf5b9113a0f88a
3
+ size 2694784
examples/driven_audio/eluosi.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4a3593815dc7b68c256672baa61934c9479efa770af2065fb0886f02713606e
3
+ size 1786672
examples/driven_audio/fayu.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16ebd13626ae4171030b4ea05cceef06078483c352e4b68d469fc2a52bfffceb
3
+ size 1940428
examples/driven_audio/imagine.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2db410217e074d91ae6011e1c5dc0b94f02d05d381c50af8e54253eeacad17d2
3
+ size 1618510
examples/driven_audio/itosinger1.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0ef5f7b4f01a68ca147e9f86f15a6e0414dd0044ba70d9a77268acae463adb8
3
+ size 500012
examples/driven_audio/japanese.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3db5426d0b158799e2be4f609b11f75bfbd4affffe18e9a1c8e6f241fcdedcfc
3
+ size 2622712
examples/source_image/art_0.png ADDED

Git LFS Details

  • SHA256: 9da3488bd82c124fab8d4825d2de59ff47e7242a2f13b4f06b3407b223bd9b59
  • Pointer size: 131 Bytes
  • Size of remote file: 750 kB
examples/source_image/art_1.png ADDED

Git LFS Details

  • SHA256: 17433c2fa2dcdbc24818f92679be1b2c794a214e7bf5671c9a5213031616ba87
  • Pointer size: 131 Bytes
  • Size of remote file: 489 kB
examples/source_image/art_10.png ADDED

Git LFS Details

  • SHA256: bf53606c234f43ddcbea16614aade50645f48850f9c4210523a8d1c09f873868
  • Pointer size: 131 Bytes
  • Size of remote file: 569 kB
examples/source_image/art_11.png ADDED

Git LFS Details

  • SHA256: d5ac1bce1f18db3f409fe46f07629c67e48e3e4f2a871566e0cfbb4cc0674159
  • Pointer size: 131 Bytes
  • Size of remote file: 489 kB
examples/source_image/art_12.png ADDED

Git LFS Details

  • SHA256: 64a8cd6fccaa4011212fa67afc5a12115aa30e8a90134709fc7f9f76b51a7f6c
  • Pointer size: 131 Bytes
  • Size of remote file: 721 kB
examples/source_image/art_13.png ADDED

Git LFS Details

  • SHA256: d7da572345c3de5d913acf306b8f06f0cabc9d4654889d42951d4426ea9bd642
  • Pointer size: 131 Bytes
  • Size of remote file: 632 kB
examples/source_image/art_14.png ADDED

Git LFS Details

  • SHA256: f43744f0dec597d4e39f3b114e0bcae8240820b3b8095af30bd4c9719ea0ea84
  • Pointer size: 131 Bytes
  • Size of remote file: 650 kB
examples/source_image/art_15.png ADDED

Git LFS Details

  • SHA256: ad44f6e18d1e98bd573d38060c1929c926eddb89f93a4d6a57cf733ab887d33a
  • Pointer size: 131 Bytes
  • Size of remote file: 673 kB
examples/source_image/art_16.png ADDED

Git LFS Details

  • SHA256: 3f6d350055eea3abe35ee3fe9df80dcd99d8edae66ef4fc20bf06168bf189f25
  • Pointer size: 132 Bytes
  • Size of remote file: 1.48 MB
examples/source_image/art_17.png ADDED

Git LFS Details

  • SHA256: 05747bb45dcf271d9bb24344bd1bce0e0746d24ce4e13545b27ad40b50c3bfe7
  • Pointer size: 132 Bytes
  • Size of remote file: 2.09 MB
examples/source_image/art_18.png ADDED

Git LFS Details

  • SHA256: 96d682448d5835ff2ff42819c6b56d17ef7afc6a186332d4b05586e0e8e95b47
  • Pointer size: 131 Bytes
  • Size of remote file: 118 kB
examples/source_image/art_19.png ADDED

Git LFS Details

  • SHA256: 8334a2f78a032e6ef4a1d369027f996967a0222e73f1aebd15b922f154797bb0
  • Pointer size: 131 Bytes
  • Size of remote file: 473 kB
examples/source_image/art_2.png ADDED

Git LFS Details

  • SHA256: 6a2e4859445765dfa40ef8fbe1f225f049b9f3784e505aa67549da728ed92657
  • Pointer size: 131 Bytes
  • Size of remote file: 832 kB
examples/source_image/art_20.png ADDED

Git LFS Details

  • SHA256: 89bcffc6e3dbc2c683559f71f355ffa711c0144e1c8fabc435493d2f979d323e
  • Pointer size: 131 Bytes
  • Size of remote file: 710 kB
examples/source_image/art_3.png ADDED

Git LFS Details

  • SHA256: 81be3a9cc605ab01cbf741330b406db5246e8bbbcb443ad43ffeca2ef161e005
  • Pointer size: 132 Bytes
  • Size of remote file: 1.35 MB
examples/source_image/art_4.png ADDED

Git LFS Details

  • SHA256: ab322220d8eab1bfefdaedea91ca5d08a34258c1ab1e585a9b1c85b32968f983
  • Pointer size: 132 Bytes
  • Size of remote file: 3.63 MB
examples/source_image/art_5.png ADDED

Git LFS Details

  • SHA256: 199217b4c839ed849577aedcad32f2bce934628b9783ba4654a93756b25e7896
  • Pointer size: 132 Bytes
  • Size of remote file: 1.23 MB
examples/source_image/art_6.png ADDED

Git LFS Details

  • SHA256: 051631a3af07966e2614fba7bd098d226697d4efc7f14839912b4a957dbff2e6
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
examples/source_image/art_7.png ADDED

Git LFS Details

  • SHA256: 33af4f794768851c72341fb9f658741a9556ba811fb7a1c206887857aa793b71
  • Pointer size: 131 Bytes
  • Size of remote file: 521 kB
examples/source_image/art_8.png ADDED

Git LFS Details

  • SHA256: 1d704497947c07ac16534299451fc0526acddf286c2ab4ceb48161ff6facc2af
  • Pointer size: 132 Bytes
  • Size of remote file: 3.12 MB
examples/source_image/art_9.png ADDED

Git LFS Details

  • SHA256: 90f84739e2aa2388efaf0fac2b57a82df279b213a8dab9faa7af8ae7468b4e80
  • Pointer size: 132 Bytes
  • Size of remote file: 1.26 MB
examples/source_image/full3.png ADDED

Git LFS Details

  • SHA256: 028571164e675a345a4c1281c6ab04a60475dc78d7de6d090494e25d2ac96bc4
  • Pointer size: 131 Bytes
  • Size of remote file: 632 kB
examples/source_image/full4.jpeg ADDED
examples/source_image/full_body_1.png ADDED

Git LFS Details

  • SHA256: b289bb5739df677798989644fc8d41c1b9490ddf15ba38bfb7ab31c1b07dc843
  • Pointer size: 131 Bytes
  • Size of remote file: 125 kB
examples/source_image/full_body_2.png ADDED

Git LFS Details

  • SHA256: 5deb8b35bbc0f5afb86d6ffc1ddc81c7ba1e761130c758d170a71c980efbc0c2
  • Pointer size: 131 Bytes
  • Size of remote file: 137 kB
examples/source_image/happy.png ADDED

Git LFS Details

  • SHA256: b5e7438dcf598f103ad9c6e5ad3a920ffda53450002c4d5b59f16001945a7f00
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
examples/source_image/happy1.png ADDED

Git LFS Details

  • SHA256: 265122e7cb73809b405323cd0eaada33e51255ab3546505e4e798c90d82ec00f
  • Pointer size: 130 Bytes
  • Size of remote file: 44 kB
examples/source_image/people_0.png ADDED

Git LFS Details

  • SHA256: db113b8d5254f77e64194a842ed25ab568834e5c983b57ed8b84e47ddbd13f07
  • Pointer size: 131 Bytes
  • Size of remote file: 244 kB
examples/source_image/sad.png ADDED

Git LFS Details

  • SHA256: a8befcfe9d6e3cdf97476f97ce8e6633fce5f478f3369099794f9365b0a0b370
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
examples/source_image/sad1.png ADDED

Git LFS Details

  • SHA256: 8e9fbe94c2ff5a43da128ec47199cd794850feff236a4fa831f526760a1f8c35
  • Pointer size: 130 Bytes
  • Size of remote file: 44.8 kB