Package: pypifuhd
Open-PIFuhdThis is aunofficialimplementation ofPIFuhdPIFuHD: Multi-Level Pixel-Aligned Implicit Function forHigh-Resolution 3D Human Digitization(CVPR2020)ImplementationTraining Coarse PIFuhdTraining Fine PIFuhdInferencemetrics(P2S, Normal, Chamfer)Gan generates front normal and back normal (Link)Unsigned distance field and signed distance filedNote that the pipeline I design do not consider normal map generated by pix2pixHD because it isNotmain difficulty we reimplement PIFuHD.PrerequisitesPyTorch>=1.6jsonPILskimagetqdmcv2trimeshwithpyembreepyexrPyOpenGLfreeglut (usesudo apt-get install freeglut3-devfor ubuntu users)(optional) egl related packages for rendering with headless machines. (useapt install libgl1-mesa-dri libegl1-mesa libgbm1for ubuntu users)face3dData processedWe useRender Peopleas our datasets but the data size is 296 (270 for training while 26 for testing) which is less than paper said 500.Note that we are unable to release the full training data due to the  restriction of commertial scans.Initial dataI modified part codes in PIFu (branch:PIFu-modify, and download it into your project) in order to could process dirs where your model savebash./scripts/process_obj.sh[--dir_models_path]#e.g.  bash ./scripts/process_obj.sh ../Garment/render_people_train/Rendering dataI modified part codes in PIFu in order to could process dirs where your model savepython-mapps.render_data-i[--dir_models_path]-o[--save_processed_models_path]-s1024[Optional:-e]#-e means use GPU rendering#e.g.python -m apps.render_data -i ../Garment/render_people_train/ -o ../Garment/render_gen_1024_train/ -s 1024 -eRender Normal MapRendering front and back normal map InCurrent ProjectAllconfigparamsissetin./configs/PIFuhd_Render_People_HG_coarse.py,bash./scripts/generate.sh# the params you could modify from ./configs/PIFuhd_Render_People_HG_normal_map.py# the import params here is#  e.g. input_dir = '../Garment/render_gen_1024_train/' and cache= "../Garment/cache/render_gen_1024/rp_train/"# inpud_dir means output render_gen_1024_train# cache means where save intermediate results like sample points from meshAfter processing all datasets,Tree-Structured Directorylooks like following:render_gen_1024_train/
├── rp_aaron_posed_004_BLD
│   ├── GEO
│   ├── MASK
│   ├── PARAM
│   ├── RENDER
│   ├── RENDER_NORMAL
│   ├── UV_MASK
│   ├── UV_NORMAL
│   ├── UV_POS
│   ├── UV_RENDER
│   └── val.txt
├── rp_aaron_posed_005_BLD
	....TrainingTraining coarse-pifuhdAll config params is set in ./configs/PIFuhd_Render_People_HG_coarse.py, Where you could modify all you want.Note that this project I designed is friend, which means you could easily replace origin backbone, head by yours :)bash./scripts/train_pfhd_coarse.shTraining Fine-PIFuhdthe same as coarse PIFuhd, all config params is set in ./configs/PIFuhd_Render_People_HG_fine.py,bash./scripts/train_pfhd_fine.sh**If you meet memory problems about GPUs, pls reduce batch_size in ./config/*.py **Inferencebash./scripts/test_pfhd_coarse.sh#orbash./scripts/test_pfhd_fine.shthe results will be saved into checkpoints/PIFuhd_Render_People_HG_[coarse/fine]/gallery/test/model_name/*.obj, then you could use meshlab to view the generate models.MetricsexportMESA_GL_VERSION_OVERRIDE=3.3# eval coarse-pifuhdpython./tools/eval_pifu.py--config./configs/PIFuhd_Render_People_HG_coarse.py# eval fine-pifuhdpython./tools/eval_pifu.py--config./configs/PIFuhd_Render_People_HG_fine.pyPretrained weightsWe provide the pretrained models of PIFuhd(fine-pifuhd,coarse-pifuhd)Note that the training models use front or back normal map rendered from mesh instead of being obtained by GANs. Therefore you need render the normal map of test objDemowe provide rendering code using free models inRenderPeople. This tutorial usesrp_dennis_posed_004model. Please download the model fromthis linkand unzip the content. Use following command to reconstruct the model:DebugI provide bool params(debug in all of config files) to you to check whether your points sampled from mesh is right. There are examples:VisualizationAs following show, left is input image, mid is the results of coarse-pifuhd, right is fine-pifuhdReconstruction on Render People DatasetsNote that our training datasets are less than official one(270 for our while 450 for paper) resulting in the performance changes in some degreeIoUACCrecallP2SNormalChamferPIFu0.7480.8800.8561.8010.14462.00Coarse-PIFuhd(+Front and back normal)0.865(5cm)0.931(5cm)0.923(5cm)1.2420.12051.4015Fine-PIFuhd(+Front and back normal)0.813(3cm)0.896(3cm)0.904(3cm)-0.1138-There is an issue why p2s of fine-pifuhd is bit large than coarse-pifuhd. This is because I do not add some post-processing to clean some chaos in reconstruction. However, the details of human mesh produced by fine-pifuhd are obviously better than coarse-pifuhd.About MeI hope that this project could provide some contributions to our communities, especially for implicit-field.By the way, If you think the project is helpful to you, pls don’t forget to star this project : )Related ResearchMonocular Real-Time Volumetric Performance Capture (ECCV 2020)Ruilong Li*, Yuliang Xiu*, Shunsuke Saito, Zeng Huang, Kyle Olszewski, Hao LiPIFuHD: Multi-Level Pixel-Aligned Implicit Function for High-Resolution 3D Human Digitization (CVPR 2020)Shunsuke Saito, Tomas Simon, Jason Saragih, Hanbyul JooARCH: Animatable Reconstruction of Clothed Humans (CVPR 2020)Zeng Huang, Yuanlu Xu, Christoph Lassner, Hao Li, Tony TungRobust 3D Self-portraits in Seconds (CVPR 2020)Zhe Li, Tao Yu, Chuanyu Pan, Zerong Zheng, Yebin LiuLearning to Infer Implicit Surfaces without 3d Supervision (NeurIPS 2019)Shichen Liu, Shunsuke Saito, Weikai Chen, Hao Li