rf100_peixos_segmentation_dataset: RF100 Peixos Segmentation Dataset

rf100_peixos_segmentation_datasetR Documentation

RF100 Peixos Segmentation Dataset

Description

Loads the Roboflow 100 "peixos" dataset for semantic segmentation. "peixos" contains 3 splits of respectively 821 / 118 / 251 color images of size 640 x 640. Segmentation masks are generated on-the-fly from polygon annotations of the unique "fish" category.

Usage

rf100_peixos_segmentation_dataset(
  split = c("train", "test", "valid"),
  root = tempdir(),
  download = FALSE,
  transform = NULL,
  target_transform = NULL
)

Arguments

split

the subset of the dataset to choose between c("train", "test", "valid").

root

directory path to download the dataset.

download

Logical. If TRUE, downloads the dataset if not present at root.

transform

Optional transform function applied to the image.

target_transform

Optional transform function applied to the target.

Value

A torch dataset. Each element is a named list with:

  • x: H × W × 3 array (use transform_to_tensor() in transform to get C × H × W tensor).

  • y: a list with:

    • masks: boolean tensor of shape (1, H, W).

    • labels: integer vector with the class index (always 1 for "fish").

The returned item is given class image_with_segmentation_mask so it can be visualised with helpers like draw_segmentation_masks().

See Also

Other segmentation_dataset: oxfordiiitpet_segmentation_dataset(), pascal_voc_datasets

Examples

## Not run: 
ds <- rf100_peixos_segmentation_dataset(
  split = "train",
  transform = transform_to_tensor,
  download = TRUE
)
item <- ds[1]
overlay <- draw_segmentation_masks(item)
tensor_image_browse(overlay)

## End(Not run)


torchvision documentation built on Nov. 6, 2025, 9:07 a.m.