VoxNet.pytorch
VoxNet.pytorch copied to clipboard
multiprocess to convert *.off to *.binvox
from multiprocessing.pool import ThreadPool as Pool
pool = Pool(8)
def convert_off2binvox(off):
binname = off.split('.')[0] + '.binvox'
if os.path.exists(binname):
print(binname, "exits, continue...")
return
os.system(f'./binvox -d 32 -cb {off}')
for c in CLASSES:
for split in ['test', 'train']:
list_offs = glob.glob(os.path.join(DATA_ROOT, c, split, '*.off'))
pool.map(convert_off2binvox, list_offs)