PIFuHD was released from Facebook Research! I decided to try PIFuHD as an extension of playing with PIFu before.
In this article, we will describe the procedure from environment construction to executing the sample prepared on Windows.
The great PIFuHD repository is here [https://github.com/facebookresearch/pifuhd)
(base)$conda create -n pifu python=3.7.0
(base)$conda activate pifu
(pifu)$conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
(pifu)$pip install pillow==6.0.0 scikit-image tqdm opencv-python trimesh
(pifu)$conda install pyopengl
This time, I installed Free GLUT instead of the original GLUT. Download "freeglut-MSVC-3.0.0-2.mp.zip" from here → unzip it I copied freeglut.dll located in freeglut \ bin \ x64 \ into C: \ Windows \ System32.
https://tadaoyamaoka.hatenablog.com/entry/2017/02/28/064625
I referred to this article. (Thank you!)
https://fukatsu.tech/windows-ffmpeg
I used the procedure in this article as it is. (Thank you!)
(pifu)$git clone https://github.com/facebookresearch/pifuhd.git
(pifu)$cd pifuhd
(pifu)$mkdir checkpoints
(pifu)$cd checkpoints
(pifu)$wget "https://dl.fbaipublicfiles.com/pifuhd/checkpoints/pifuhd.pt" -O pifuhd.pt
(pifu)$cd ..
If you don't have wget, download pifuhd.pt directly from here and store it under checkpoints.
I got an error when using OpenGL in my environment, so I modified lib / render / gl / render.py as follows.
[render.py]
class Render:
def __init__(self, width=1600, height=1200, name='GL Renderer',
program_files=['simple.fs', 'simple.vs'], color_size=1, ms_rate=1):
self.width = width
self.height = height
self.name = name
self.display_mode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH
self.use_inverse_depth = False
global _glut_window
if _glut_window is None:
glutInit()
glutInitDisplayMode(self.display_mode)
glutInitWindowSize(self.width, self.height)
glutInitWindowPosition(0, 0)
#Fix here
# _glut_window = glutCreateWindow("My Render.")
_glut_window = glutCreateWindow(b"My Render.")
(pifu)$python -m apps.simple_test
(pifu)$python -m apps.render_turntable -f ./results/pifuhd_final/recon -ww 512 -hh 512
When you execute the above command, you will see the following animation on the screen!
In addition, I think that "result_test_512.mp4" is also output under results / pifuhd_final / recon.
This time, I tried running the PIFuHD sample published by Facebook Research on Windows. Basically, if you check README.md, you can easily try it.
In the future, I will try using my own images instead of the prepared samples. PIFu had to be Sementic-Segmentation, but in PIFuHD it seems that the key point information obtained by Pose-Estimation is sufficient. Officially, a trial method using OpenPose was published, but I think that anything can be done if the output format can be matched by the Pose-Estimation algorithm separately.
Recommended Posts