% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transforms-segmentation.R
\name{target_transform_coco_masks}
\alias{target_transform_coco_masks}
\title{Target Transform: COCO Polygon Segmentation to Masks}
\usage{
target_transform_coco_masks(y)
}
\arguments{
\item{y}{list being COCO dataset target variable, with names \code{segmentation}, \code{image_height}, \code{image_width}.}
}
\value{
Modified \code{y} list with added \code{masks} field (N, H, W) boolean tensor, N being the number of
classes.
}
\description{
Converts COCO-style polygon segmentation annotations from target \verb{$segmentation} variable
into boolean mask tensors as target \verb{$masks} variable in order to ease later-on visualisation
via \code{draw_segmentation_mask()}.
Use as \code{target_transform} in \code{coco_detection_dataset()}.
}
\examples{
\dontrun{
ds <- coco_detection_dataset(
  root = "data",
  target_transform = target_transform_coco_masks
)
item <- ds[1]
draw_segmentation_masks(item)
}

}
\seealso{
Other target_transforms: 
\code{\link{target_transform_trimap_masks}()}
}
\concept{target_transforms}
