yfeng95 / PRNet

Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network (ECCV 2018)
http://openaccess.thecvf.com/content_ECCV_2018/papers/Yao_Feng_Joint_3D_Face_ECCV_2018_paper.pdf
MIT License
4.96k stars 944 forks source link

How to get the *.mat files for jpg? And how to process a video file? #1

Closed htjoy closed 6 years ago

htjoy commented 6 years ago

Hi I've tried the run_basics.py, it works for the images in TestImages folder. But how could I get the *.mat file? And I run the python script for a video file(running with dlib) on a mac computer , I found that the processing speed is very slow(2,3 seconds per frame), so does it must run with GPU acceleration to get high processing speed? Thanks!

yfeng95 commented 6 years ago

Hi, thanks for your reporting. : ) For your first question, '*.mat' is not necessary, this file is uploaded only for providing bounding box information and testing the code(The test images and corresponding mat data are from AFLW2000, a classical test dataset). For your own images, you can directly input the images and use dlib to crop the face by

prn = PRN(is_dlib = True, is_opencv = False) # use dlib 
pos = prn.process(image) 

Actually, I think you have found that. However, for clear usage, I just uploaded a new file run.py, you can directly run it.

For the second, Yes, using GPU is faster than CPU(about ~x20). Meanwhile , as mentioned in our paper, we only record the run time of the process which is defined from inputing the cropped face image until recovering the 3D geometry(~0.2s with CPU tested on Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz).
However, other parts also take a lot of time:

  1. crop face and restore the position.
  2. write_obj function.(I will optimize it one day) You can test the time on each part and optimize it on you self.

Hope that helps.

pallavis-n commented 5 years ago

I was looking at training and I need .mat files in order to get the information I need to train, but I do not know how to go about getting those files. I know @YadiraF mentioned that they come in the dataset, but I looked in the AFLW datasets and many others and could not find the .mat files. The closest I found were .pts files that hold the 2D 68 keypoints on the 2D image. How would I go about getting the .mat files for my own .jpg or .png images?