Skip to content

multiprocess to convert *.off to *.binvox #2

@zlin-monarch

Description

@zlin-monarch
  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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions