basename paths

This commit is contained in:
Starbeamrainbowlabs 2022-10-20 15:11:14 +01:00
parent 4d8ae21a45
commit 59cfa4a89a
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ def get_filepaths(dirpath_input, shuffle=True):
if shuffle:
result = shuffle(result)
else:
result = sorted(result, key=lambda filepath: int(filepath.split(".", 1)[0]))
result = sorted(result, key=lambda filepath: int(os.path.basename(filepath).split(".", 1)[0]))
return result

View file

@ -71,7 +71,7 @@ def get_filepaths(dirpath_input, shuffle=True):
if shuffle:
result = shuffle(result)
else:
result = sorted(result, key=lambda filepath: int(filepath.split(".", 1)[0]))
result = sorted(result, key=lambda filepath: int(os.path.basename(filepath).split(".", 1)[0]))
return result
def dataset_segmenter(dirpath_input, batch_size=64, train_percentage=0.8, parallel_reads_multiplier=1.5, water_threshold=0.1, shape_water_desired=[100,100]):