← 开源
ascust

3DMM-Fitting-Pytorch

A 3DMM fitting framework using Pytorch.

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
653
Star
97
Fork
+0
本周
1
贡献者
创建于 2020-11-24 · 更新于 2026-08-24 · 今日第 15450 名
主要开发者
ascust

ascust/3DMM-Fitting-Pytorch 排名第 15,450,有 653 个星标。

同类别比较

ascust/3DMM-Fitting-Pytorch 排名第 15,450,此处有 8 个同类条目;Yuliang-Liu/Curve-Text-Detector 排名第 15,449。

同类别比较
名称排名指标
fangchangma/self-supervised-depth-completion15,440
语言:
Python
星标数:
654
分叉数:
134
简介:
ICRA 2019 "Self-supervised Sparse-to-Dense: Self-supervised Depth Completion from LiDAR and Monocular Camera"
kvh/ramp15,444
语言:
Python
星标数:
654
分叉数:
97
简介:
Rapid Machine Learning Prototyping in Python
tensorflow/tcav15,446
语言:
Jupyter Notebook
星标数:
654
分叉数:
148
简介:
Code for the TCAV ML interpretability project
Yuliang-Liu/Curve-Text-Detector15,449
语言:
Jupyter Notebook
星标数:
653
分叉数:
156
简介:
This repository provides train&test code, dataset, det.&rec. annotation, evaluation script, annotation tool, and ranking.
choosewhatulike/trainable-agents15,452
语言:
Python
星标数:
653
分叉数:
51
简介:
Code and datasets for "Character-LLM: A Trainable Agent for Role-Playing"
leaderj1001/Attention-Augmented-Conv2d15,457
语言:
Python
星标数:
653
分叉数:
101
简介:
Implementing Attention Augmented Convolutional Networks using Pytorch
sotetsuk/pgx15,458
语言:
Python
星标数:
653
分叉数:
56
简介:
♟️ Vectorized RL game environments in JAX
uxlfoundation/oneDAL15,460
语言:
C++
星标数:
653
分叉数:
228
简介:
oneAPI Data Analytics Library (oneDAL)
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词3D, Computer vision
星标数653
分叉数97
贡献者1
创建日期2020-11-24
更新日期2026-08-24
1 天星标数0
7 天星标数0
排名15,450
上次排名15,260
排名变化-190
7 天星标排名15,004
上次 7 天星标排名15,008
7 天星标排名变化4
总星标排名15,693
上次总星标排名15,661
总星标排名变化-32
README 摘录

3DMM model fitting using Pytorch This is a fitting framework implemented in Pytorch for reconstructing the face in an image or a video using a 3DMM model. The framework only uses Pytorch modules and a differentiable renderer from pytorch3d. The whole module is differentiable and can be integrated into other systems for the gradient propagation. Updates :star2: Refactored the code to make future extension easier (other 3DMM models will be supported). The hyper-parameters are also re-organized. :star2: Added

support for monocular video reconstruction. :star2: Added support for multi-gpu when processing long videos. Installation Requirements pytorch3d It might require a specific version of Pytorch to make pytorch3d run succussfully on gpus, please follow the official instructions. Basel Face Model 2009 (BFM09) Expression Basis extra expression basis. Download the Basel Face Model and put "01_MorphableModel. Go to the repo, download the "CoarseData" and put "Exp_Pca. Convert the BFM parameters by: Single Image Reconstruction The results are stored

in "results" folder. Monocular Video Reconstruction To fit a video, simply run: The script will extract frames, detact features and fit all frames. Fitting a video is a bit different from fitting an image, because frames are not isolated. Then we estimate the other coefficients (expression, rotatation etc. ) for each frame and keep the shape and texture coefficients fixed. For the first frame, we use much more iterations to get a good starting point. For remaining frames, each is initialized

from the previous estimation. Pose regulerizers are also imposed to increase temporal consistency. Please check the reconstructed video in the result folder. Multi-gpu and -process support It could take quite a while to process a long video, so multi-gpu and multi-process are also supported to accelerate fitting. To use this feature, simply run: Here we use 4 gpus and 4 workers. We can also use more workers to assign each gpu with multiple workers. The video will

be evenly split and each clip will be fit respectively. Hyperparameters There are bunch of parameters that might require further tuning. Try to change it to find a trade-off between speed and accuracy. If the result is not good, try to play with the parameters. Acknowledgement The code is partially borrowed from Deep3DFaceReconstrution, which is a Tensorflow-based deep reconstruction method using CNNs. Please note that our framework does not require any pretrained deep models. We estimate the parameters

directly using the landmarks and photometric loss as the supervision.

常见问题

记录了多少星标和分叉?

ascust/3DMM-Fitting-Pytorch 有 653 个星标和 97 个分叉。

仓库排名是多少?

ascust/3DMM-Fitting-Pytorch 排名第 15,450。

记录的语言和类别是什么?

ascust/3DMM-Fitting-Pytorch 有 653 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

ascust/3DMM-Fitting-Pytorch 与 Yuliang-Liu/Curve-Text-Detector 比较,后者排名第 15,449,有 653 个星标。

README

3DMM model fitting using Pytorch

This is a fitting framework implemented in Pytorch for reconstructing the face in an image or a video using a 3DMM model.

The framework only uses Pytorch modules and a differentiable renderer from pytorch3d. The whole module is differentiable and can be integrated into other systems for the gradient propagation.

Updates

  • :star2: Refactored the code to make future extension easier (other 3DMM models will be supported). The hyper-parameters are also re-organized.

  • :star2: Added support for monocular video reconstruction.

  • :star2: Added support for multi-gpu when processing long videos.

Installation

Requirements

  • pytorch3d It might require a specific version of Pytorch to make pytorch3d run succussfully on gpus, please follow the official instructions.
  • Please refer to "requirements.txt" for other dependences.
  • Basel Face Model 2009 (BFM09)
  • Expression Basis extra expression basis.

How to use

Installation

  1. Clone the repo:
git clone https://github.com/ascust/3DMM-Fitting-Pytorch
cd 3DMM-Fitting-Pytorch
  1. Download the Basel Face Model and put "01_MorphableModel.mat" and put it into "BFM".

  2. Download the Expression Basis. Go to the repo, download the "CoarseData" and put "Exp_Pca.bin" into "BFM".

  3. Convert the BFM parameters by:

python convert_bfm09_data.py

Single Image Reconstruction

python fit_single_img.py --img_path data/000002.jpg --res_folder results 

The results are stored in "results" folder.

Monocular Video Reconstruction

To fit a video, simply run:

python fit_video.py --v_path data/sample_video.mp4 --res_folder results 

The script will extract frames, detact features and fit all frames.

Fitting a video is a bit different from fitting an image, because frames are not isolated. In this implementation, we first estimate shape and texture of the target face using some of the frames (indicated by --nframes_shape). Then we estimate the other coefficients (expression, rotatation etc.) for each frame and keep the shape and texture coefficients fixed.

For the first frame, we use much more iterations to get a good starting point. For remaining frames, each is initialized from the previous estimation.Pose regulerizers are also imposed to increase temporal consistency.

Please check the reconstructed video in the result folder.

Multi-gpu and -process support

It could take quite a while to process a long video, so multi-gpu and multi-process are also supported to accelerate fitting. To use this feature, simply run:

python fit_video.py --v_path data/sample_video.mp4 --res_folder results --ngpus 4 --nworkers 4

Here we use 4 gpus and 4 workers. We can also use more workers to assign each gpu with multiple workers. The video will be evenly split and each clip will be fit respectively.

Hyperparameters

There are bunch of parameters that might require further tuning. The iteration numbers for non-rigid fitting "--first_nrf_iters" and "--rest_nrf_iters" affect the fitting speed a lot since we have to render the 3d mesh in each iteration. Try to change it to find a trade-off between speed and accuracy. If the result is not good, try to play with the parameters.

Acknowledgement

The code is partially borrowed from Deep3DFaceReconstrution, which is a Tensorflow-based deep reconstruction method using CNNs. Please note that our framework does not require any pretrained deep models. We estimate the parameters directly using the landmarks and photometric loss as the supervision.

排名相邻
同类项目