Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zlin-monarch opened this issue Jun 22, 2023 · 0 comments
Open

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

zlin-monarch opened this issue Jun 22, 2023 · 0 comments

Comments

@zlin-monarch
Copy link

  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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant