VoxNet.pytorch icon indicating copy to clipboard operation
VoxNet.pytorch copied to clipboard

multiprocess to convert *.off to *.binvox

Open zlin-monarch opened this issue 1 year ago • 0 comments

  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)

zlin-monarch avatar Jun 22 '23 11:06 zlin-monarch