remap_from_preset#
- Dataset.remap_from_preset(input_dataset_map: str, output_dataset_map: str, remove_not_mapped: bool = True, remove_emptied_images: bool = False) Self[source]#
Same as class remap, but instead of taking a dictionary, you give the name of a preset. Registered presets are stored in remap_presets folders, with csv files in the form
{inputr_dataset_map}_to_{output_dataset_map}- Parameters:
input_dataset_map – Name of label map to convert from.
output_dataset_map – Name of label to convert to.
remove_not_mapped – If set to True, will remove classes that are not in class mapping. Otherwise, keep them as is (with potential class fusion). Defaults to True.
remove_emptied_images – If set to True, will remove from
self.imagesthe images that are now empty of annotation. Note that it will keep the images that were empty before the remapping. Defaults to False.
- Returns:
New dataset object with remapped classes according to the preset
- Raises:
KeyError – raised when the input/output pair does not exists in presets.