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

error in get_train_val path

parent a26c1bca
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ def export_split(argument, entry, path, directory):
f.write(f'nc: {len(species_list)}\n')
f.write(f'names: {[str(x) for x in species_list.species.tolist()]}')
def prepare_data(arguments):
"""
Prepare the annotation before getting splited
......@@ -98,22 +99,26 @@ if __name__ == '__main__':
df = prepare_data(args)
train, val = utils.split(df, 'train', args.ratio)
saved_directory = os.path.join(args.directory, 'set')
if args.test:
val, test = utils.split(val, 'val', 0.5)
export_split(args, [train, val, test], args.path_to_data, args.directory)
export_split(args, [train, val, test], args.path_to_data,
saved_directory)
state, proposition = utils.get_set_info([train, val, test])
else:
export_split(args, [train, val], args.path_to_data, args.directory)
export_split(args, [train, val], args.path_to_data, saved_directory)
state, proposition = utils.get_set_info([train, val])
print(f'\nYour dataset is {state} {proposition}')
print(f'Train saved in {args.directory}\n')
print(f'Train saved in {saved_directory}\n')
print('To train your model, use the following command : \n')
current_path = os.getcwd()
directory_path = os.path.join(current_path, args.directory, 'set')
directory_path = os.path.join(current_path, saved_directory)
yolo_path = os.path.join(current_path, 'yolov5/train.py')
data_path = os.path.join(directory_path, 'custom_data.yaml')
weights_path = os.path.join(current_path, 'yolov5/weights/yolov5l.pt')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment