def METHOD_NAME(coco_instances, backbone, head):
    datamodule = InstanceSegmentationData.from_coco(
        train_folder=coco_instances.train_folder,
        train_ann_file=coco_instances.train_ann_file,
        predict_folder=coco_instances.predict_folder,
        transform_kwargs={"image_size": (128, 128)},
        batch_size=2,
    )
    assert datamodule.num_classes == 3
    assert datamodule.labels == ["background", "cat", "dog"]
    model = InstanceSegmentation(num_classes=datamodule.num_classes, backbone=backbone, head=head)
    trainer = Trainer(fast_dev_run=True)
    trainer.fit(model, datamodule=datamodule)
    trainer.predict(model, datamodule=datamodule)