pytorch/projects/tools/modelnet.py [138:162]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  points_folder = os.path.join(root_folder, 'ModelNet40.points')
  original_folder = points_folder + ".dense"
  if os.path.exists(points_folder):
    os.rename(points_folder, original_folder)

  folders = os.listdir(original_folder)
  for folder in folders:
    for subfolder in ['train', 'test']:
      curr_folder = os.path.join(original_folder, folder, subfolder)
      # write filelist to disk
      filenames = os.listdir(curr_folder)
      filelist_name = os.path.join(curr_folder, 'list.txt')
      with open(filelist_name, 'w') as fid:
        for filename in filenames:
          if filename.endswith('.points'):
            fid.write(os.path.join(curr_folder, filename) + '\n')
      # run simplify_points
      output_path = os.path.join(points_folder, folder, subfolder)
      if not os.path.exists(output_path):
        os.makedirs(output_path)
      cmd = '%s --filenames %s --output_path %s --dim %d' % \
            (simplify, filelist_name, output_path, resolution)
      print(cmd)
      os.system(cmd)
      os.remove(filelist_name)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tensorflow/data/cls_modelnet.py [171:195]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  points_folder = os.path.join(root_folder, 'ModelNet40.points')
  original_folder = points_folder + ".dense"
  if os.path.exists(points_folder):
    os.rename(points_folder, original_folder)

  folders = os.listdir(original_folder)
  for folder in folders:
    for subfolder in ['train', 'test']:
      curr_folder = os.path.join(original_folder, folder, subfolder)
      # write filelist to disk
      filenames = os.listdir(curr_folder)
      filelist_name = os.path.join(curr_folder, 'list.txt')
      with open(filelist_name, 'w') as fid:
        for filename in filenames:
          if filename.endswith('.points'):
            fid.write(os.path.join(curr_folder, filename) + '\n')
      # run simplify_points
      output_path = os.path.join(points_folder, folder, subfolder)
      if not os.path.exists(output_path):
        os.makedirs(output_path)
      cmd = '%s --filenames %s --output_path %s --dim %d' % \
            (simplify, filelist_name, output_path, resolution)
      print(cmd)
      os.system(cmd)
      os.remove(filelist_name)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



