def from_pets(
    train_folder: Optional[str] = None,
    train_ann_file: Optional[str] = None,
    val_folder: Optional[str] = None,
    val_ann_file: Optional[str] = None,
    test_folder: Optional[str] = None,
    test_ann_file: Optional[str] = None,
    predict_folder: Optional[str] = None,
    val_split: float = 0.1,
    parser: Optional[Callable] = None,
    transform_kwargs: Optional[Dict[str, Any]] = None,
    batch_size: int = 1,
    **data_module_kwargs,
) -> InstanceSegmentationData:
    """Downloads and loads the pet data set from icedata."""
    data_dir = icedata.pets.load_data()

    if parser is None:
        parser = partial(icedata.pets.parser, mask=True)

    return InstanceSegmentationData.from_icedata(
        train_folder=train_folder or data_dir,
        train_ann_file=train_ann_file,
        val_folder=val_folder,
        val_ann_file=val_ann_file,
        test_folder=test_folder,
        test_ann_file=test_ann_file,
        predict_folder=predict_folder,
        transform_kwargs={"image_size": (128, 128)} if transform_kwargs is None else transform_kwargs,
        parser=parser,
        val_split=val_split,
        batch_size=batch_size,
        **data_module_kwargs,
    )
Downloads and loads the pet data set from icedata.
src/flash/image/instance_segmentation/cli.py