Dataset Module¶
This module holds functionality related to dataset management. Both for downloading and iterating on the dataset.
In the project we use 2 datasets:
COCO (for training the fast image transform net)
Some public videos (for training the Video style transfer net)
-
class
stransfer.dataset.CocoDataset(images=None, image_limit=None)[source]¶ An implementation of the
torch.utils.data.Datasetclass, specific for the COCO dataset
-
class
stransfer.dataset.VideoDataset(videos=None, data_limit=None, batch_size=3)[source]¶ Dataset wrapper for the video dataset
-
stransfer.dataset.download_coco_images()[source]¶ Ensures that the coco dataset is downloaded
- Return type
None- Returns
None
-
stransfer.dataset.download_list_of_urls(urls, destination_folder='data/video/')[source]¶ Download a list of urls into destination_folder
-
stransfer.dataset.download_videos_dataset()[source]¶ Ensures that the videos in the video dataset have been downloaded
- Return type
None- Returns
None
-
stransfer.dataset.get_coco_loader(batch_size=4, test_split=0.1, test_limit=None, train_limit=None)[source]¶ Sets up and returns the dataloaders for the coco dataset
- Parameters
batch_size – the amount of elements we want per batch
test_split – the percentage of items from the whole set that we want to be part of the test set
test_limit – the maximum amount of items we want in our test set
train_limit – the maximum amount of items we want in the training set
- Return type
Tuple[DataLoader,DataLoader]- Returns
the test set dataloader, and the train set dataloader