Coder Social home page Coder Social logo

unsupervised-detail-layer's Introduction

unsupervised-detail-layer

Code repository for paper "Self-supervised Learning of Detailed 3D Face Reconstruction (TIP2020)"

pipeline
pipeline

Prerequisite

  • python 3.7
  • tensorflow 1.15
  • g++ 4.8 (other version might also work)
  • tf_mesh_renderer

Please read install.sh for more details. It installs all packages required to run the codes, and compiles the c++ kernel of the differentiable renderer. Pay attention to finding the correct path to TF_INC and TF_LIB. The path specified in install.sh might not suit your case. If it does not work, please try to find them manually. You can also compile the codes using methods provided by tf_mesh_renderer.

Files

We release the checkpoint files, resources, and some testing results for our model. As the training tfrecords are huge, we only provide one tfrecord for testing our codes. We will release the url in baidu drive in some days.

google drive

  • Please download the training data train_data.zip into the repo root directory ./ and unzip them.
  • Please download the checkpoints ckptxxx.zip into ./results/ and unzip them.
  • Please download the resources.zip into the repo root directory ./ and unzip it.
  • Please download the frozen_models.zip into ./preprocess/ and unzip it. They are face detection and landmark detection models used in proprocessing a face image.

Running

  • In run_train.sh, we provide commands for training the coarse / fine model.
  • In run_test.sh, we provide commands for inference. Note that the batch_size should be 1.

Citation

If you use the codes provided here in your paper, please cite the following.

@article{chen2019self,
  title={Self-supervised Learning of Detailed 3D Face Reconstruction},
  author={Chen, Yajing and Wu, Fanzi and Wang, Zeyu and Song, Yibing and Ling, Yonggen and Bao, Linchao},
  journal={IEEE Transactions on Image Processing},
  year={2020}
}

Acknowledgement

Our codes use the differentiable renderer and vggface backbone provided in the following two repos. We thank them for providing the codes.

Contact

If you have any questions regarding this work, please send emails to [email protected].

License

MIT License

Copyright (c) [2020] [Yajing Chen]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

unsupervised-detail-layer's People

Contributors

cyj907 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

unsupervised-detail-layer's Issues

训练模型问题

您好,我在训练完粗模型后再跑精细模型,出现ValueError: Can't load save_path when it is None. 是为什么? 相关的数据集、资源包都已按照说明放好路径。

error in install.sh

Collecting absl-py==0.9.0 (from -r requirements.txt (line 1))
  Cache entry deserialization failed, entry ignored
Collecting asgiref==3.2.10 (from -r requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d5/eb/64725b25f991010307fd18a9e0c1f0e6dff2f03622fc4bcbcdb2244f60d6/asgiref-3.2.10-py3-none-any.whl
Collecting astor==0.8.1 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl
Collecting cycler==0.10.0 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting decorator==4.4.2 (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/ed/1b/72a1821152d07cf1d8b6fce298aeb06a7eb90f4d6d41acec9861e7cc6df0/decorator-4.4.2-py2.py3-none-any.whl
Collecting Django==3.1 (from -r requirements.txt (line 6))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/2b/5a/4bd5624546912082a1bd2709d0edc0685f5c7827a278d806a20cf6adea28/Django-3.1-py3-none-any.whl (7.8MB)
    100% |████████████████████████████████| 7.8MB 184kB/s 
Collecting gast==0.2.2 (from -r requirements.txt (line 7))
  Cache entry deserialization failed, entry ignored
Collecting google-pasta==0.2.0 (from -r requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 11.6MB/s 
Collecting grpcio==1.31.0 (from -r requirements.txt (line 9))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/e3/0e/f56aa1f8200ae3c5d38305e69f5920caa480c7ff54ae4d8a5f57d1d69fa4/grpcio-1.31.0.tar.gz (20.0MB)
    100% |████████████████████████████████| 20.0MB 69kB/s 
Collecting h5py==2.10.0 (from -r requirements.txt (line 10))
  Downloading https://files.pythonhosted.org/packages/60/06/cafdd44889200e5438b897388f3075b52a8ef01f28a17366d91de0fa2d05/h5py-2.10.0-cp36-cp36m-manylinux1_x86_64.whl (2.9MB)
    100% |████████████████████████████████| 2.9MB 493kB/s 
Collecting image==1.5.32 (from -r requirements.txt (line 11))
  Cache entry deserialization failed, entry ignored
Collecting imageio==2.9.0 (from -r requirements.txt (line 12))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/6e/57/5d899fae74c1752f52869b613a8210a2480e1a69688e65df6cb26117d45d/imageio-2.9.0-py3-none-any.whl (3.3MB)
    100% |████████████████████████████████| 3.3MB 436kB/s 
Collecting importlib-metadata==1.7.0 (from -r requirements.txt (line 13))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/8e/58/cdea07eb51fc2b906db0968a94700866fc46249bdc75cac23f9d13168929/importlib_metadata-1.7.0-py2.py3-none-any.whl
Collecting Keras-Applications==1.0.8 (from -r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
    100% |████████████████████████████████| 51kB 12.5MB/s 
Collecting Keras-Preprocessing==1.1.2 (from -r requirements.txt (line 15))
  Downloading https://files.pythonhosted.org/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42kB)
    100% |████████████████████████████████| 51kB 14.2MB/s 
Collecting kiwisolver==1.2.0 (from -r requirements.txt (line 16))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ae/23/147de658aabbf968324551ea22c0c13a00284c4ef49a77002e91f79657b7/kiwisolver-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (88kB)
    100% |████████████████████████████████| 92kB 11.7MB/s 
Collecting Markdown==3.2.2 (from -r requirements.txt (line 17))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/a4/63/eaec2bd025ab48c754b55e8819af0f6a69e2b1e187611dd40cbbe101ee7f/Markdown-3.2.2-py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 12.8MB/s 
Collecting matplotlib==3.3.0 (from -r requirements.txt (line 18))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/93/ae/81b1c98ae97350711adb021ee12ea678b37f608ec2faa35c3a7db11795fa/matplotlib-3.3.0-1-cp36-cp36m-manylinux1_x86_64.whl (11.5MB)
    100% |████████████████████████████████| 11.5MB 122kB/s 
Collecting networkx==2.4 (from -r requirements.txt (line 19))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 893kB/s 
Collecting numpy==1.19.1 (from -r requirements.txt (line 20))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/22/e7/4b2bdddb99f5f631d8c1de259897c2b7d65dcfcc1e0a6fd17a7f62923500/numpy-1.19.1-cp36-cp36m-manylinux1_x86_64.whl (13.4MB)
    100% |████████████████████████████████| 13.4MB 105kB/s 
Collecting opencv-python==4.4.0.40 (from -r requirements.txt (line 21))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/e0/6f/237b730227927c15a68ec831a51bc83837bb65d54bf9651c08b474201b9a/opencv-python-4.4.0.40.tar.gz (88.9MB)
    100% |████████████████████████████████| 88.9MB 16kB/s 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-f8_91pk8/opencv-python/
compiling rasterizer
mkdir: cannot create directory ‘./tools/kernels’: File exists
./tools/src_mesh_renderer/rasterize_triangles_grad.cc:18:10: fatal error: tensorflow/core/framework/op.h: No such file or directory
 #include "tensorflow/core/framework/op.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
./tools/src_mesh_renderer/rasterize_triangles_op.cc:19:10: fatal error: tensorflow/core/framework/op.h: No such file or directory
 #include "tensorflow/core/framework/op.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

制作tfrecord文件的脚本

您好,我最近在复现您的工作,但是在制作tfrecord文件时遇到了问题,请问您能分享一下制作tfrecord文件的脚本吗?或者您能分享一下您制作好的tfrecord文件吗?

3d landmark loss

Hi! Thanks for sharing such a nice work!
I am trying to train the work with another dataset.
And I noticed the use of landmark3d_loss in the code, which I cannot find in the paper.
I wonder how you got the GT 3D landmark data of CelebA,
and also wonder what the 'segmentation' in the dataset is.

Thanks in advance!

segmentation

Hi! Thanks for the fantastic work. I noticed the size of segmentation image of celeba-hq is 512, but the size in the training set is 300.
I wonder how you processed the training image and if it is ok to train without 'segmentation'.

关于evaluation方法

您好,想问一下文中提到的point-to-plane error, point-to-point error 在MICC 数据集上的测试,这部分代码是怎么实现的呀,怎么做crop呢?
目前我在其他项目也没有找到公开的衡量工具。

Checksum does not match:

Hi Guys;

When I tried to test your code; I got the following error:
tensorflow.python.framework.errors_impl.DataLossError: Checksum does not match: stored 26150082 vs. calculated on the restored bytes 1746058966
[[{{node save/RestoreV2}}]]

关于标记点的loss

  我对你的文章很感兴趣,但是有些实现细节想请教你,你是如何根据3dmm系数得到mesh的标记点的,在你的代码中,mesh的标记点是这样得到的

image

然而你在导入的basic3dmm中的 keypoint'是这样得到的
image
直接赋予固定值么?

关于86个三维特征点

您好,我对你们的工作很感兴趣,觉得你们做的非常棒,但是有些地方我没还没有弄明白想要请教您:为什么数据集里有3d landmark ground truth?这篇文章解决的问题是只用二维照片和特征点进行训练吗?这86个3d landmark 论文中没找到相关的loss

关于数据集的问题

您好!我对您的这个项目很感兴趣,但我在看项目的readme时,说是完整的数据集将不久在百度网盘中放出,请问现在有了么?还有个问题是,您的数据集用的是已经标记好的数据集还是in the wild?如果我要自己下载数据集,我应该下载celeba哪个数据集?期望您的回复,谢谢!

Hope for the code

Hi,

Thank you very much for your great work! May I know when the codes are available?

关于数据预处理的问题

'''
image_load, landmark2d_load, landmark3d_load, seg_load, glassframe_load =
DataSet.load(
args.data_dir, args.batch_size, options
)
'''
您好!我想请问一下这个glassframe是指什么,怎么得到它?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.