scripts namespace¶
Submodules¶
scripts.create_seg_labels_and_index_files module¶
generate segmentation label files (png) and the required index files for training and testing
usage: create_seg_labels_and_index_files.py –root <path to dataset> –train_files <comma seperated list of json files containing train data> –test_files <list containing test data>
-
scripts.create_seg_labels_and_index_files.
draw
(im, line, idx, show=False)[source]¶ Generate the segmentation label according to json annotation
-
scripts.create_seg_labels_and_index_files.
generate_segmentation_and_train_list
(root, line_txt, names)[source]¶ The lane annotations of the Tusimple dataset is not strictly in order, so we need to find out the correct lane order for segmentation. We use the same definition as CULane, in which the four lanes from left to right are represented as 1,2,3,4 in segentation label respectively.
scripts.create_smaller_train_set module¶
-
scripts.create_smaller_train_set.
create_smaller_train_set
(file_in, keep: int = 10, out_filename='small_train_labels.json')[source]¶ Training with large datasets will take a huge amount of time. Especially if the dataset was recorded at a high framerate this script could be used to increase training speed by creating a smaller train_labels file.
- Parameters
file_in – absolute path to a train_labels.json file
keep – Percentage of frames to keep (20% -> 20)
out_filename – Filename of the new labels file. It will be created in the same directory where file_in is located
Returns:
scripts.reduce_h_samples module¶
scripts.show_labels_on_image module¶
scripts.split_dataset module¶
-
scripts.split_dataset.
split_dataset
(file_in, test_split: int = 10, validate_split: int = 10)[source]¶ split one labels file into train, test, validate labels files. Creates the following files: train_labels.json, test.json, validate.json in the same folder as the source file is located
- Parameters
file_in – path to labels file
test_split – test percentage
validate_split – validate percentage