Datasets for recognizing invidual dolphins from images

Download and load dataset

stack_imgs[source]

stack_imgs(imgs:List[Image], width:int=None)

Stacks images horizontaly in one large image. Very useful for debugging purposes.

imgs = [img for img, _ in dataset]

stack_imgs(imgs[:4]).resize((800, 120))

display_batches[source]

display_batches(data_loader:DataLoader, n_batches:int=1, width:int=800, show_y:bool=False)

Displays n_batches, one batch per row.

display_batches(data_loader)
display_batches(data_loader_test)

get_image2tensor_transforms[source]

get_image2tensor_transforms(train:bool)

Converts image to tensor

get_dataset[source]

get_dataset(name:str, get_tensor_transforms:Callable[bool, Callable[Image, Any]]=get_image2tensor_transforms, batch_size:int=4, num_workers:int=4, n_samples:int=-1)

Get one of two datasets available. The parameter name can be one of 'segmentation' and 'classification'

get_test_dataset[source]

get_test_dataset(name:str, get_tensor_transforms:Callable[bool, Callable[Image, Any]]=get_image2tensor_transforms, batch_size:int=4, num_workers:int=4, n_samples:int=-1)

When create dataset loaders, we must pass two functions returning transformations on an image and on tensors.

data_loader, data_loader_val = get_dataset("segmentation", batch_size=4)

display_batches(data_loader, n_batches=3)