def save_schema(path: str, task_type: str, ids: List[int], names: List[str]) -> None:
    """Saves a prediction schema in the right format.

    Args:
        path:
            Where to store the schema.
        task_type:
            Task type (e.g. classification, object-detection).
        ids:
            List of category ids.
        names:
            List of category names.
    """
    if len(ids) != len(names):
        raise ValueError("ids and names must have same length!")

    schema = {
        "task_type": task_type,
        "categories": [{"id": id, "name": name} for id, name in zip(ids, names)],
    }
    with open(path, "w") as f:
        json.dump(schema, f)
Saves a prediction schema in the right format.

    Args:
        path:
            Where to store the schema.
        task_type:
            Task type (e.g. classification, object-detection).
        ids:
            List of category ids.
        names:
            List of category names.
    
lightly/utils/io.py