dataset fixing
This commit is contained in:
@ -56,14 +56,18 @@ class CustomShapeNet(InMemoryDataset):
|
||||
def processed_file_names(self):
|
||||
return [f'{self.mode}.pt']
|
||||
|
||||
def __download(self):
|
||||
dir_count = len([name for name in os.listdir(self.raw_dir) if os.path.isdir(os.path.join(self.raw_dir, name))])
|
||||
def check_and_resolve_cloud_count(self):
|
||||
if self.raw_dir.exists():
|
||||
dir_count = len([name for name in os.listdir(self.raw_dir) if os.path.isdir(os.path.join(self.raw_dir, name))])
|
||||
|
||||
if dir_count:
|
||||
print(f'{dir_count} folders have been found....')
|
||||
return dir_count
|
||||
warn(ResourceWarning("No raw pointclouds have been found. Was this intentional?"))
|
||||
return dir_count
|
||||
if dir_count:
|
||||
print(f'{dir_count} folders have been found....')
|
||||
return dir_count
|
||||
else:
|
||||
warn(ResourceWarning("No raw pointclouds have been found. Was this intentional?"))
|
||||
return dir_count
|
||||
warn(ResourceWarning("The raw data folder does not exist. Was this intentional?"))
|
||||
return -1
|
||||
|
||||
@property
|
||||
def num_classes(self):
|
||||
@ -87,6 +91,10 @@ class CustomShapeNet(InMemoryDataset):
|
||||
print('Dataset Loaded')
|
||||
break
|
||||
except FileNotFoundError:
|
||||
status = self.check_and_resolve_cloud_count()
|
||||
if status in [0, -1]:
|
||||
print(f'No dataset was loaded, status: {status}')
|
||||
break
|
||||
self.process()
|
||||
continue
|
||||
return data, slices
|
||||
|
Reference in New Issue
Block a user