-
Notifications
You must be signed in to change notification settings - Fork 5
/
visualize_scan.py
31 lines (26 loc) · 964 Bytes
/
visualize_scan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
This loads scan and visualizes segmentation and texture on it
'''
import os
from os.path import split, join, exists
from glob import glob
import pickle as pkl # Python 3 change
from shutil import copyfile
from psbody.mesh import Mesh, MeshViewer
import numpy as np
import cv2
if __name__ == '__main__':
# path = '/BS/bharat/work/MGN_release/Multi-Garment_dataset/125611508622317'
path = '/media/minar/Galaxy/Datasets/Multi-Garment_dataset/125611508622317'
# path = '/media/minar/Galaxy/Datasets/Multi-Garment_dataset/125611511816959'
scan = Mesh(filename=join(path, 'scan.obj'))
seg = np.load(join(path, 'scan_labels.npy'))
tex_file = join(path, 'scan_tex.jpg')
scan.set_texture_image(tex_file)
scan.show()
input('next?')
scan2 = Mesh(filename=join(path, 'scan.obj'))
scan2.set_vertex_colors_from_weights(seg.reshape(-1,))
scan2.show()
input('finish?')
print('Done')