Shortcuts

Flickr8k

class torchvision.datasets.Flickr8k(root: str, ann_file: str, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None)[source]

Flickr8k Entities Dataset.

Parameters
  • root (string) – Root directory where images are downloaded to.

  • ann_file (string) – Path to annotation file.

  • transform (callable, optional) – A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.ToTensor

  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it.

Special-members

__getitem__(index: int)Tuple[Any, Any][source]
Parameters

index (int) – Index

Returns

Tuple (image, target). target is a list of captions for the image.

Return type

tuple

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources