{"id":17984,"date":"2024-08-10T17:00:32","date_gmt":"2024-08-10T09:00:32","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=17984"},"modified":"2025-01-10T17:15:14","modified_gmt":"2025-01-10T09:15:14","slug":"aniportrait","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/ja\/aniportrait\/","title":{"rendered":"AniPortrait\uff1a\u97f3\u9891\u9a71\u52a8\u56fe\u7247\u6216\u89c6\u9891\u52a8\u4f5c\u751f\u6210\u903c\u771f\u7684\u6570\u5b57\u4eba\u8bb2\u8bdd\u89c6\u9891"},"content":{"rendered":"<p>AniPortrait\u662f\u4e00\u4e2a\u7531\u97f3\u9891\u9a71\u52a8\u751f\u6210\u903c\u771f\u7684\u8096\u50cf\u52a8\u753b\u7684\u521b\u65b0\u6846\u67b6\u3002\u8be5\u9879\u76ee\u7531\u817e\u8baf\u6e38\u620f\u77e5\u5df1\u5b9e\u9a8c\u5ba4\u7684\u534e\u4e3a\u4f1f\u3001\u6768\u6cfd\u4fca\u548c\u738b\u5fd7\u58f0\u5f00\u53d1\u3002AniPortrait\u80fd\u591f\u901a\u8fc7\u97f3\u9891\u548c\u53c2\u8003\u8096\u50cf\u56fe\u50cf\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u52a8\u753b\uff0c\u751a\u81f3\u53ef\u4ee5<strong>\u63d0\u4f9b\u89c6\u9891\u8fdb\u884c\u9762\u90e8\u91cd\u73b0<\/strong>\u3002\u901a\u8fc7\u4f7f\u7528\u5148\u8fdb\u76843D\u4e2d\u95f4\u8868\u793a\u548c2D\u9762\u90e8\u52a8\u753b\u6280\u672f\uff0c\u8be5\u6846\u67b6\u80fd\u591f\u751f\u6210\u81ea\u7136\u6d41\u7545\u7684\u52a8\u753b\u6548\u679c\uff0c\u9002\u7528\u4e8e\u5f71\u89c6\u5236\u4f5c\u3001\u865a\u62df\u4e3b\u64ad\u548c\u6570\u5b57\u4eba\u7b49\u591a\u79cd\u5e94\u7528\u573a\u666f\u3002<\/p>\n<div id=\"attachment_17985\" style=\"width: 1359px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17985\" class=\"wp-image-17985 size-full\" title=\"AniPortrait\uff1a\u97f3\u9891\u9a71\u52a8\u751f\u6210\u903c\u771f\u7684\u6570\u5b57\u4eba\u8bf4\u8bdd\u89c6\u9891-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc.png\" alt=\"AniPortrait\uff1a\u97f3\u9891\u9a71\u52a8\u751f\u6210\u903c\u771f\u7684\u6570\u5b57\u4eba\u8bf4\u8bdd\u89c6\u9891-1\" width=\"1349\" height=\"830\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc.png 1349w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc-300x185.png 300w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc-1024x630.png 1024w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc-768x473.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/5a7ef942f7643dc-18x12.png 18w\" sizes=\"auto, (max-width: 1349px) 100vw, 1349px\" \/><p id=\"caption-attachment-17985\" class=\"wp-caption-text\">\u6f14\u793a\u5730\u5740\uff1ahttps:\/\/huggingface.co\/spaces\/ZJYang\/AniPortrait_official<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17986\" title=\"AniPortrait\uff1a\u97f3\u9891\u9a71\u52a8\u56fe\u7247\u6216\u89c6\u9891\u52a8\u4f5c\u751f\u6210\u903c\u771f\u7684\u6570\u5b57\u4eba\u8bb2\u8bdd\u89c6\u9891-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/65dc6022754f6ff.png\" alt=\"AniPortrait\uff1a\u97f3\u9891\u9a71\u52a8\u56fe\u7247\u6216\u89c6\u9891\u52a8\u4f5c\u751f\u6210\u903c\u771f\u7684\u6570\u5b57\u4eba\u8bb2\u8bdd\u89c6\u9891-1\" width=\"819\" height=\"576\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/65dc6022754f6ff.png 819w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/65dc6022754f6ff-300x211.png 300w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/65dc6022754f6ff-768x540.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/01\/65dc6022754f6ff-18x12.png 18w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li>\u97f3\u9891\u9a71\u52a8\u52a8\u753b\uff1a\u901a\u8fc7\u97f3\u9891\u8f93\u5165\u751f\u6210\u5bf9\u5e94\u7684\u8096\u50cf\u52a8\u753b\u3002<\/li>\n<li>\u89c6\u9891\u9a71\u52a8\u52a8\u753b\uff1a\u63d0\u4f9b\u89c6\u9891\u8fdb\u884c\u9762\u90e8\u91cd\u73b0\uff0c\u751f\u6210\u903c\u771f\u7684\u9762\u90e8\u52a8\u753b\u3002<\/li>\n<li>\u9ad8\u8d28\u91cf\u52a8\u753b\u751f\u6210\uff1a\u4f7f\u75283D\u4e2d\u95f4\u8868\u793a\u548c2D\u9762\u90e8\u52a8\u753b\u6280\u672f\uff0c\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u52a8\u753b\u6548\u679c\u3002<\/li>\n<li>\u7f51\u7edc\u754c\u9762\u6f14\u793a\uff1a\u901a\u8fc7Gradio Web UI\u63d0\u4f9b\u5728\u7ebf\u6f14\u793a\uff0c\u65b9\u4fbf\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n<li>\u6a21\u578b\u8bad\u7ec3\u4e0e\u63a8\u7406\uff1a\u652f\u6301\u6a21\u578b\u7684\u8bad\u7ec3\u4e0e\u63a8\u7406\uff0c\u7528\u6237\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u548c\u751f\u6210\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5<\/h3>\n<h4>\u73af\u5883\u642d\u5efa<\/h4>\n<p>\u63a8\u8350\u4f7f\u7528Python\u7248\u672c&gt;=3.10\u548cCUDA\u7248\u672c=11.7\u3002\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u642d\u5efa\u73af\u5883\uff1a<\/p>\n<pre><code>pip install -r requirements.txt\r\n<\/code><\/pre>\n<h4>\u4e0b\u8f7d\u6743\u91cd<\/h4>\n<p>\u6240\u6709\u6743\u91cd\u6587\u4ef6\u5e94\u653e\u7f6e\u5728<code>.\/pretrained_weights<\/code>\u76ee\u5f55\u4e0b\u3002\u624b\u52a8\u4e0b\u8f7d\u6743\u91cd\u6587\u4ef6\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u8bad\u7ec3\u597d\u7684\u6743\u91cd\uff0c\u5305\u62ec\u4ee5\u4e0b\u90e8\u5206\uff1a<code>denoising_unet.pth<\/code>\u3001<code>reference_unet.pth<\/code>\u3001<code>pose_guider.pth<\/code>\u3001<code>motion_module.pth<\/code>\u7b49\u3002<\/li>\n<li>\u4e0b\u8f7d\u57fa\u7840\u6a21\u578b\u548c\u5176\u4ed6\u7ec4\u4ef6\u7684\u9884\u8bad\u7ec3\u6743\u91cd\uff1a\n<ul>\n<li>StableDiffusion V1.5<\/li>\n<li>sd-vae-ft-mse<\/li>\n<li>image_encoder<\/li>\n<li>wav2vec2-base-960h<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u6743\u91cd\u6587\u4ef6\u7ed3\u6784\u7ec4\u7ec7\u5982\u4e0b\uff1a<\/p>\n<pre><code>.\/pretrained_weights\/\r\n|-- image_encoder\r\n|   |-- config.json\r\n|   `-- pytorch_model.bin\r\n|-- sd-vae-ft-mse\r\n|   |-- config.json\r\n|   |-- diffusion_pytorch_model.bin\r\n|   `-- diffusion_pytorch_model.safetensors\r\n|-- stable-diffusion-v1-5\r\n|   |-- feature_extractor\r\n|   |   `-- preprocessor_config.json\r\n|   |-- model_index.json\r\n|   |-- unet\r\n|   |   |-- config.json\r\n|   |   `-- diffusion_pytorch_model.bin\r\n|   `-- v1-inference.yaml\r\n|-- wav2vec2-base-960h\r\n|   |-- config.json\r\n|   |-- feature_extractor_config.json\r\n|   |-- preprocessor_config.json\r\n|   |-- pytorch_model.bin\r\n|   |-- README.md\r\n|   |-- special_tokens_map.json\r\n|   |-- tokenizer_config.json\r\n|   `-- vocab.json\r\n|-- audio2mesh.pt\r\n|-- audio2pose.pt\r\n|-- denoising_unet.pth\r\n|-- film_net_fp16.pt\r\n|-- motion_module.pth\r\n|-- pose_guider.pth\r\n`-- reference_unet.pth\r\n<\/code><\/pre>\n<h3>Gradio Web UI<\/h3>\n<p>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5c1d\u8bd5\u6211\u4eec\u7684\u7f51\u7edc\u6f14\u793a\u3002\u6211\u4eec\u8fd8\u63d0\u4f9b\u4e86<a href=\"https:\/\/huggingface.co\/spaces\/ZJYang\/AniPortrait_official\">\u5728\u7ebf\u6f14\u793a<\/a>\u3002<\/p>\n<pre><code>python -m scripts.app\r\n<\/code><\/pre>\n<h3>\u63a8\u7406<\/h3>\n<p>\u8bf7\u6ce8\u610f\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u4e2d\u8bbe\u7f6e<code>-L<\/code>\u4e3a\u6240\u9700\u7684\u751f\u6210\u5e27\u6570\uff0c\u4f8b\u5982<code>-L 300<\/code>\u3002<\/p>\n<p><strong>\u52a0\u901f\u65b9\u6cd5<\/strong>\uff1a\u5982\u679c\u751f\u6210\u89c6\u9891\u65f6\u95f4\u8fc7\u957f\uff0c\u53ef\u4ee5\u4e0b\u8f7d<a href=\"https:\/\/huggingface.co\/ZJYang\/AniPortrait\/tree\/main\">film_net_fp16.pt<\/a>\u5e76\u653e\u7f6e\u5728<code>.\/pretrained_weights<\/code>\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u8fd0\u884c\u63a8\u7406\u811a\u672c\u7684CLI\u547d\u4ee4\uff1a<\/p>\n<h4>\u81ea\u9a71\u52a8<\/h4>\n<pre><code>python -m scripts.pose2vid --config .\/configs\/prompts\/animation.yaml -W 512 -H 512 -acc\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u53c2\u8003<code>animation.yaml<\/code>\u683c\u5f0f\u6dfb\u52a0\u81ea\u5df1\u7684\u53c2\u8003\u56fe\u50cf\u6216\u59ff\u6001\u89c6\u9891\u3002\u5c06\u539f\u59cb\u89c6\u9891\u8f6c\u6362\u4e3a\u59ff\u6001\u89c6\u9891\uff08\u5173\u952e\u70b9\u5e8f\u5217\uff09\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>python -m scripts.vid2pose --video_path pose_video_path.mp4\r\n<\/code><\/pre>\n<h4>\u9762\u90e8\u91cd\u73b0<\/h4>\n<pre><code>python -m scripts.vid2vid --config .\/configs\/prompts\/animation_facereenac.yaml -W 512 -H 512 -acc\r\n<\/code><\/pre>\n<p>\u5728<code>animation_facereenac.yaml<\/code>\u4e2d\u6dfb\u52a0\u6e90\u9762\u90e8\u89c6\u9891\u548c\u53c2\u8003\u56fe\u50cf\u3002<\/p>\n<h4>\u97f3\u9891\u9a71\u52a8<\/h4>\n<pre><code>python -m scripts.audio2vid --config .\/configs\/prompts\/animation_audio.yaml -W 512 -H 512 -acc\r\n<\/code><\/pre>\n<p>\u5728<code>animation_audio.yaml<\/code>\u4e2d\u6dfb\u52a0\u97f3\u9891\u548c\u53c2\u8003\u56fe\u50cf\u3002\u5220\u9664<code>animation_audio.yaml<\/code>\u4e2d\u7684<code>pose_temp<\/code>\u53ef\u4ee5\u542f\u7528audio2pose\u6a21\u578b\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u6b64\u547d\u4ee4\u751f\u6210\u7528\u4e8e\u5934\u90e8\u59ff\u6001\u63a7\u5236\u7684<code>pose_temp.npy<\/code>\uff1a<\/p>\n<pre><code>python -m scripts.generate_ref_pose --ref_video .\/configs\/inference\/head_pose_temp\/pose_ref_video.mp4 --save_path .\/configs\/inference\/head_pose_temp\/pose.npy\r\n<\/code><\/pre>\n<h3>\u8bad\u7ec3<\/h3>\n<h4>\u6570\u636e\u51c6\u5907<\/h4>\n<p>\u4e0b\u8f7d<a href=\"https:\/\/liangbinxie.github.io\/projects\/vfhq\/\">VFHQ<\/a>\u548c<a href=\"https:\/\/github.com\/CelebV-HQ\/CelebV-HQ\">CelebV-HQ<\/a>\u3002\u4ece\u539f\u59cb\u89c6\u9891\u4e2d\u63d0\u53d6\u5173\u952e\u70b9\u5e76\u7f16\u5199\u8bad\u7ec3json\u6587\u4ef6\uff08\u4ee5\u4e0b\u662f\u5904\u7406VFHQ\u7684\u793a\u4f8b\uff09\uff1a<\/p>\n<pre><code>python -m scripts.preprocess_dataset --input_dir VFHQ_PATH --output_dir SAVE_PATH --training_json JSON_PATH\r\n<\/code><\/pre>\n<p>\u5728\u8bad\u7ec3\u914d\u7f6e\u6587\u4ef6\u4e2d\u66f4\u65b0\u884c\uff1a<\/p>\n<pre><code>data:\r\njson_path: JSON_PATH\r\n<\/code><\/pre>\n<h4>\u9636\u6bb51<\/h4>\n<p>\u8fd0\u884c\u547d\u4ee4\uff1a<\/p>\n<pre><code>accelerate launch train_stage_1.py --config .\/configs\/train\/stage1.yaml\r\n<\/code><\/pre>\n<h4>\u9636\u6bb52<\/h4>\n<p>\u5c06\u9884\u8bad\u7ec3\u7684\u8fd0\u52a8\u6a21\u5757\u6743\u91cd<code>mm_sd_v15_v2.ckpt<\/code>(<a href=\"https:\/\/huggingface.co\/guoyww\/animatediff\/blob\/main\/mm_sd_v15_v2.ckpt\">\u4e0b\u8f7d\u94fe\u63a5<\/a>)\u653e\u7f6e\u5728<code>.\/pretrained_weights<\/code>\u76ee\u5f55\u4e0b\u3002\u5728<code>stage2.yaml<\/code>\u914d\u7f6e\u6587\u4ef6\u4e2d\u6307\u5b9a\u9636\u6bb51\u7684\u8bad\u7ec3\u6743\u91cd\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code>stage1_ckpt_dir: '.\/exp_output\/stage1'\r\nstage1_ckpt_step: 30000\r\n<\/code><\/pre>\n<p>\u8fd0\u884c\u547d\u4ee4\uff1a<\/p>\n<pre><code>accelerate launch train_stage_2.py --config .\/configs\/train\/stage2.yaml<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AniPortrait\u662f\u4e00\u4e2a\u7531\u97f3\u9891\u9a71\u52a8\u751f\u6210\u903c\u771f\u7684\u8096\u50cf\u52a8\u753b\u7684\u521b\u65b0\u6846\u67b6\u3002\u8be5\u9879\u76ee\u7531\u817e\u8baf\u6e38\u620f\u77e5\u5df1\u5b9e\u9a8c\u5ba4\u7684\u534e\u4e3a\u4f1f\u3001\u6768\u6cfd\u4fca\u548c\u738b\u5fd7\u58f0\u5f00\u53d1\u3002AniPortrait\u80fd\u591f\u901a\u8fc7\u97f3\u9891\u548c\u53c2\u8003\u8096\u50cf\u56fe\u50cf\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u52a8\u753b\uff0c\u751a\u81f3\u53ef\u4ee5\u63d0\u4f9b\u89c6\u9891\u8fdb\u884c\u9762\u90e8\u91cd\u73b0\u3002\u901a\u8fc7\u4f7f\u7528\u5148\u8fdb\u76843D\u4e2d&#8230;<\/p>\n","protected":false},"author":1,"featured_media":60890,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[228],"class_list":["post-17984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aishuziren"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/17984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/comments?post=17984"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/17984\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/media\/60890"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/media?parent=17984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/categories?post=17984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/tags?post=17984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}