learning3d 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,8 @@ from scipy.spatial.distance import minkowski
16
16
  from scipy.spatial import cKDTree
17
17
  from torch.utils.data import Dataset
18
18
 
19
- def download_modelnet40():
20
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
21
- DATA_DIR = os.path.join(BASE_DIR, os.pardir, 'data')
19
+ def download_modelnet40(root_dir):
20
+ DATA_DIR = os.path.join(root_dir, 'data')
22
21
  if not os.path.exists(DATA_DIR):
23
22
  os.mkdir(DATA_DIR)
24
23
  if not os.path.exists(os.path.join(DATA_DIR, 'modelnet40_ply_hdf5_2048')):
@@ -28,11 +27,10 @@ def download_modelnet40():
28
27
  os.system('mv %s %s' % (zipfile[:-4], DATA_DIR))
29
28
  os.system('rm %s' % (zipfile))
30
29
 
31
- def load_data(train, use_normals):
30
+ def load_data(root_dir, train, use_normals):
32
31
  if train: partition = 'train'
33
32
  else: partition = 'test'
34
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
35
- DATA_DIR = os.path.join(BASE_DIR, os.pardir, 'data')
33
+ DATA_DIR = os.path.join(root_dir, 'data')
36
34
  all_data = []
37
35
  all_label = []
38
36
  for h5_name in glob.glob(os.path.join(DATA_DIR, 'modelnet40_ply_hdf5_2048', 'ply_data_%s*.h5' % partition)):
@@ -186,13 +184,14 @@ class ModelNet40Data(Dataset):
186
184
  self,
187
185
  train=True,
188
186
  num_points=1024,
189
- download=True,
187
+ root_dir='./',
190
188
  randomize_data=False,
191
189
  use_normals=False
192
190
  ):
193
191
  super(ModelNet40Data, self).__init__()
194
- if download: download_modelnet40()
195
- self.data, self.labels = load_data(train, use_normals)
192
+ self.root_dir = root_dir
193
+ if root_dir is not None: download_modelnet40(root_dir=root_dir)
194
+ self.data, self.labels = load_data(root_dir, train, use_normals)
196
195
  if not train: self.shapes = self.read_classes_ModelNet40()
197
196
  self.num_points = num_points
198
197
  self.randomize_data = randomize_data
@@ -218,8 +217,7 @@ class ModelNet40Data(Dataset):
218
217
  return self.shapes[label]
219
218
 
220
219
  def read_classes_ModelNet40(self):
221
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
222
- DATA_DIR = os.path.join(BASE_DIR, os.pardir, 'data')
220
+ DATA_DIR = os.path.join(self.root_dir, 'data')
223
221
  file = open(os.path.join(DATA_DIR, 'modelnet40_ply_hdf5_2048', 'shape_names.txt'), 'r')
224
222
  shape_names = file.read()
225
223
  shape_names = np.array(shape_names.split('\n')[:-1])
@@ -362,10 +360,9 @@ class FlowData(Dataset):
362
360
 
363
361
 
364
362
  class SceneflowDataset(Dataset):
365
- def __init__(self, npoints=1024, root='', partition='train'):
363
+ def __init__(self, root_dir, npoints=1024, root='', partition='train'):
366
364
  if root == '':
367
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
368
- DATA_DIR = os.path.join(BASE_DIR, os.pardir, 'data')
365
+ DATA_DIR = os.path.join(root_dir, 'data')
369
366
  root = os.path.join(DATA_DIR, 'data_processed_maxcut_35_20k_2k_8192')
370
367
  if not os.path.exists(root):
371
368
  print("To download dataset, click here: https://drive.google.com/file/d/1CMaxdt-Tg1Wct8v8eGNwuT7qRSIyJPY-/view")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: learning3d
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Learning3D: A Modern Library for Deep Learning on 3D Point Clouds Data
5
5
  Author-email: Vinit Sarode <vinitsarode5@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/vinits5/learning3d
@@ -1,6 +1,6 @@
1
1
  learning3d/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  learning3d/data_utils/__init__.py,sha256=iYAVh0FThnVlG42QIgmDYrC3NGVYuzKX8s1oRqAI1YU,261
3
- learning3d/data_utils/dataloaders.py,sha256=kb0wsLlMN7sB-CS_4BGSprSaZBwkUNYxS5iwUdD6JJM,14871
3
+ learning3d/data_utils/dataloaders.py,sha256=xoH9gzfcCUOqcRL3G_Qjglt-vuNooIW2oqgRDhT3nv8,14703
4
4
  learning3d/data_utils/user_data.py,sha256=ADDGeCUCr6TcXhcxvAFncIeLO71xoRHYi4H418ktvQs,4828
5
5
  learning3d/examples/test_dcp.py,sha256=o1hgl22b2xhqqYe4_k7NlNo3-rIMmSzzssCI74DCfoE,5606
6
6
  learning3d/examples/test_deepgmr.py,sha256=pb-gRE6YLLaPFmiBXQjaE-B-J314QY4RkNwLHx65bcU,5597
@@ -73,8 +73,8 @@ learning3d/utils/pointconv_util.py,sha256=kJxGztai7X15YsGuorMOc50SPtj_k1yfkP4XCT
73
73
  learning3d/utils/ppfnet_util.py,sha256=HEoxkgUBlawKZLWspfQm3caWUyAMIrW-ECtStNYbe2Y,7989
74
74
  learning3d/utils/svd.py,sha256=yCYQt2SKqeIzCBnBEr_8xFR79m4fIoNVFnp77epn1dM,1936
75
75
  learning3d/utils/transformer.py,sha256=UDgJvnh7ekWyijaAn-a3ckeFeMxlK_chXzWlhAGDiPM,8974
76
- learning3d-0.0.3.dist-info/LICENSE,sha256=3qY3_NeQIvalbLlsHFtOfuUKjs_U2k6u7rf6YVx6ac0,1098
77
- learning3d-0.0.3.dist-info/METADATA,sha256=RjRxCmF_3xda4kPWDCvP2QjyPSysHZdNm3PY42-Jlhg,15813
78
- learning3d-0.0.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
79
- learning3d-0.0.3.dist-info/top_level.txt,sha256=nTmYW8NhbNV1_15DGNpl_OvvSFtQP98sy3qrrHr0eLo,11
80
- learning3d-0.0.3.dist-info/RECORD,,
76
+ learning3d-0.0.5.dist-info/LICENSE,sha256=3qY3_NeQIvalbLlsHFtOfuUKjs_U2k6u7rf6YVx6ac0,1098
77
+ learning3d-0.0.5.dist-info/METADATA,sha256=gdmOxHdGi3GXBcPxKYWAdHvr9S8tSVNjMN2W_B_aiww,15813
78
+ learning3d-0.0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
79
+ learning3d-0.0.5.dist-info/top_level.txt,sha256=nTmYW8NhbNV1_15DGNpl_OvvSFtQP98sy3qrrHr0eLo,11
80
+ learning3d-0.0.5.dist-info/RECORD,,