該存儲庫是通過通過神經合成分析的CVPR 2024論文3D面部表達式的正式實施。
傻笑從單眼圖像中重建了3D面,忠實地恢復了極端,不對稱和微妙的表達方式。
您需要安裝Pytorch和Pytorch3D的工作版本。我們提供了一個requirements.txt
。
conda create -n傻笑python = 3.9 pip install -r requirements.txt# install pytorch3d nowpip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu117_pyt201/download.html
然後,為了下載所需的模型,請運行:
bash quick_install.sh
以上安裝包括下載火焰模型。這需要註冊。如果您沒有帳戶,則可以在https://flame.is.tue.mpg.de/上註冊
該命令還將下載假定的模型,該模型也可以在Google Drive上找到。
我們提供兩個演示。一個可用於在單個圖像上測試模型的一種
python demo.py --input_path樣本/test_image2.png -out_path結果/ - checkpoint pretraining_models/smirk_em1.pt - crop-crop-crop-crop
並且可以用來在視頻上測試模型的一種
python demo_video.py --input_path samples/dafoe.mp4 -out_path results/-checkpoint pretraining_models/smirk_em1.pt -crop -crop -render_orig
Smikk接受了以下數據集的組合培訓:LRS3,Mead,Celeba和FFHQ。
§§從這裡加載LRS3數據集。我們知道目前該數據集已從網站上刪除。它可以用任何其他類似的數據集替換,例如LRS2。
從這裡下載米德數據集。
從這裡下載Celeba數據集。您可以直接下載對齊的圖像img_align_celeba.zip
。
從此處下載FFHQ256數據集。
下載數據集後,我們需要使用MediaPipe和Fan提取地標。我們提供用於在datasets/preprocess_scripts
中進行預處理的腳本。示例用法:
python數據集/preprocess_scripts/apply_mediapipe_to_dataset.py--input_dir path_to_ffhq256/images -output_dir path_to_to_ffhq256/mediapipe_landmarkss
對於粉絲:
python數據集/preprocess_scripts/apply_fan_to_dataset.py --input_dir path_to_ffhq256/images -of -output_dir path_to_to_ffhq256/fan_landmarks
請注意,對於獲取風扇地標,我們在https://github.com/hhj1897/face_alignment中使用該實現。
接下來,請確保在configs
中更新配置文件,並使用正確的路徑到數據集及其地標。
在預處理階段,我們僅使用提取的地標和雲母的輸出來訓練所有3個編碼器(姿勢,形狀和表達)。
python train.py configs/config_pretrain.yaml train.log_path =“ logs/prebrain”
預處理後,在傻笑的核心階段,我們將形狀和姿勢編碼器凍結,並用完整的傻笑框架(重建路徑和循環路徑)訓練表達編碼器。
python train.py configs/config_train.yaml簡歷= logs/priprain/firt_stage_pretraining_encoder.pt train.loss_weights.emotion_loss = 1.0
如果您覺得這項工作有用,請考慮引用:
@inproceedings {smikk:cvpr:2024,title = {3D面部表達,通過分析by-by-nural-synsysis},作者= {retsinas,George和filntisis,Panagiotis P.和Danecek,Danecek,Danecek,Radek和Radek和Radek和Abrevaya,Victoria F.和Roussos, ,Anastasios和Bolkart,Timo和Maragos,Petros},BookTitle = {計算機視覺和模式識別會議(CVPR)},年= {2024}}
我們承認這項工作中使用的以下存儲庫和論文:
雲母
emoca
自動鏈接