eladrich / pix2vertex.pytorch

An official pyTorch port of the pix2vertex paper from ICCV2017
MIT License
192 stars 24 forks source link

Vertices, Colors and Triangles #5

Closed mrizwan18 closed 3 years ago

mrizwan18 commented 4 years ago

So I ran this piece of code and it gave me visualization of that 3D face mesh but how do I get vertices, colors and triangles out of this object:

import pix2vertex as p2v
from imageio import imread
image = imread("trump.jpg")

detector = p2v.Detector()
reconstructor = p2v.Reconstructor(detector=detector)
img_crop = detector.detect_and_crop(image)
net_res = reconstructor.run_net(img_crop)
p2v.vis_net_result(img_crop,net_res)
final_res = reconstructor.post_process(net_res)
eladrich commented 3 years ago

Added an option to export the result as an STL file

p2v.save2stl(result['Z_surface'], 'res.stl')