train_tools.data_utils.utils¶
Module Contents¶
- train_tools.data_utils.utils.split_train_valid(data_dicts, valid_portion=0.1)[source]¶
Split train/validata data according to the given proportion
- train_tools.data_utils.utils.path_decoder(root, mapping_file, no_label=False, unlabeled=False)[source]¶
Decode img/label file paths from root & mapping directory.
- Parameters:
root (str)
mapping_file (str) – json file containing image & label file paths.
no_label (bool, optional) – whether to include “label” key. Defaults to False.
- Returns:
list of dictionary. (ex. [{“img”: img_path, “label”: label_path}, …])
- Return type:
list