def METHOD_NAME(key_val_dict: dict):
    """
    Transforms data from form to correct data types before converting to object.
    Arguments:
        key_val_dict: Flat dictionary from :py:class:`TrainingEditorWidget`.
    Returns:
        None, modifies dict in place.
    """
    if "outputs.tags" in key_val_dict and isinstance(key_val_dict["outputs.tags"], str):
        key_val_dict["outputs.tags"] = [
            tag.strip() for tag in key_val_dict["outputs.tags"].split(",")
        ]
    if "_ensure_channels" in key_val_dict:
        ensure_channels = key_val_dict["_ensure_channels"].lower()
        ensure_rgb = False
        ensure_grayscale = False
        if ensure_channels == "rgb":
            ensure_rgb = True
        elif ensure_channels == "grayscale":
            ensure_grayscale = True
        key_val_dict["data.preprocessing.ensure_rgb"] = ensure_rgb
        key_val_dict["data.preprocessing.ensure_grayscale"] = ensure_grayscale
    if "model.backbone.resnet.upsampling.skip_connections" in key_val_dict:
        if key_val_dict["model.backbone.resnet.upsampling.skip_connections"] == "":
            key_val_dict["model.backbone.resnet.upsampling.skip_connections"] = None
    # Overwrite backbone strides with stride from head.
    backbone_name = find_backbone_name_from_key_val_dict(key_val_dict)
    if backbone_name is not None:
        max_stride, output_stride = resolve_strides_from_key_val_dict(
            key_val_dict, backbone_name
        )
        key_val_dict[f"model.backbone.{backbone_name}.output_stride"] = output_stride
        key_val_dict[f"model.backbone.{backbone_name}.max_stride"] = max_stride
    # Convert random flip dropdown selection to config.
    random_flip = key_val_dict.get(
        "optimization.augmentation_config.random_flip", "none"
    )
    if random_flip == "none":
        key_val_dict["optimization.augmentation_config.random_flip"] = False
    else:
        key_val_dict["optimization.augmentation_config.random_flip"] = True
        key_val_dict["optimization.augmentation_config.flip_horizontal"] = (
            random_flip == "horizontal"
        )