compressai.datasets

compressai.datasets#

ImageFolder#

class compressai.datasets.ImageFolder(root, transform=None, split='train')[source]#

Load an image folder database. Training and testing image samples are respectively stored in separate directories:

- rootdir/
    - train/
        - img000.png
        - img001.png
    - test/
        - img000.png
        - img001.png
Parameters:
  • root (string) – root directory of the dataset

  • transform (callable, optional) – a function or transform that takes in a PIL image and returns a transformed version

  • split (string) – split mode (‘train’ or ‘val’)

VideoFolder#

class compressai.datasets.VideoFolder(root, rnd_interval=False, rnd_temp_order=False, transform=None, split='train')[source]#

Load a video folder database. Training and testing video clips are stored in a directorie containing mnay sub-directorie like Vimeo90K Dataset:

- rootdir/
    train.list
    test.list
    - sequences/
        - 00010/
            ...
            -0932/
            -0933/
            ...
        - 00011/
            ...
        - 00012/
            ...

training and testing (valid) clips are withdrew from sub-directory navigated by corresponding input files listing relevant folders.

This class returns a set of three video frames in a tuple. Random interval can be applied to if subfolders includes more than 6 frames.

Parameters:
  • root (string) – root directory of the dataset

  • rnd_interval (bool) – enable random interval [1,2,3] when drawing sample frames

  • transform (callable, optional) – a function or transform that takes in a PIL image and returns a transformed version

  • split (string) – split mode (‘train’ or ‘test’)