def METHOD_NAME(im_type, d, keys=("img", "image", "label")):
    out = deepcopy(d)
    for k, v in out.items():
        if k in keys and isinstance(v, np.ndarray):
            out[k] = im_type(v)
    return out