better regex filtering for smaller memory usage

This commit is contained in:
Si11ium 2019-08-02 18:37:52 +02:00
parent d291d49a2d
commit 1af300988a

View File

@ -100,7 +100,15 @@ class CustomShapeNet(InMemoryDataset):
paths.extend(glob.glob(os.path.join(pointcloud.path, f'*.{ext}')))
for element in paths:
if all([x not in os.path.split(element)[-1] for x in ['pc.dat', 'pc.xyz']]):
# This was build to filter all variations that aregreater then 25
pattern = re.compile('^((2[5-9]|[3-5][0-9])_\w+?\d+?|pc|\d+?_pc)\.(xyz|dat)$')
if pattern.match(os.path.split(element)[-1]):
continue
else:
# The following two lines were intendations
# check if it is "just" a pc.dat or pc.xyz
# if all([x not in os.path.split(element)[-1] for x in ['pc.dat', 'pc.xyz']]):
# Assign training data to the data container
# Following the original logic;
# y should be the label;