Skip to content
Snippets Groups Projects
Commit 64fa6b0b authored by Stephane Chavin's avatar Stephane Chavin
Browse files

correct rsplit errors

parent b7bd4917
No related branches found
No related tags found
No related merge requests found
...@@ -88,14 +88,17 @@ def export_split(entry, path, directory): ...@@ -88,14 +88,17 @@ def export_split(entry, path, directory):
if args.test == 1: if args.test == 1:
test = entry[2] test = entry[2]
test.file = test.file.str.rsplit('.').str[0] #test.file = test.file.str.rsplit('.').str[0]
test.file = ['.'.join(x.rsplit('.')[:-1]) for num, x in enumerate(test.file)]
create_directory_if_not_exists(os.path.join(directory, 'images/test')) create_directory_if_not_exists(os.path.join(directory, 'images/test'))
create_directory_if_not_exists(os.path.join(directory, 'labels/test')) create_directory_if_not_exists(os.path.join(directory, 'labels/test'))
copy_files_to_directory(test.file, path, os.path.join(directory, 'labels/test'), 'txt') copy_files_to_directory(test.file, path, os.path.join(directory, 'labels/test'), 'txt')
copy_files_to_directory(test.file, os.path.join(path, '../images/all'), os.path.join(directory, 'images/test'), 'jpg') copy_files_to_directory(test.file, os.path.join(path, '../images/all'), os.path.join(directory, 'images/test'), 'jpg')
val.file = val.file.str.rsplit('.').str[0] #val.file = val.file.str.rsplit('.').str[0]
train.file = train.file.str.rsplit('.').str[0] val.file = ['.'.join(x.rsplit('.')[:-1]) for num, x in enumerate(val.file)]
#train.file = train.file.str.rsplit('.').str[0]
train.file = ['.'.join(x.rsplit('.')[:-1]) for num, x in enumerate(train.file)]
create_directory_if_not_exists(os.path.join(directory, 'images/train')) create_directory_if_not_exists(os.path.join(directory, 'images/train'))
create_directory_if_not_exists(os.path.join(directory, 'images/val')) create_directory_if_not_exists(os.path.join(directory, 'images/val'))
create_directory_if_not_exists(os.path.join(directory, 'labels/train')) create_directory_if_not_exists(os.path.join(directory, 'labels/train'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment