Last active
September 8, 2017 12:00
-
-
Save esc/a15ff21a29a8bc71e4d1fc247b514828 to your computer and use it in GitHub Desktop.
GulpIO Blogpost Adapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractDatasetAdapter(ABC): | |
""" Base class adapter for gulping (video) datasets. | |
Inherit from this class and implement the `iter_data` method. This method | |
should iterate over your entire dataset and for each element return a | |
dictionary with the following fields: | |
id : a unique(?) ID for the element. | |
frames : a list of frames (PIL images, numpy arrays..) | |
meta : a dictionary with arbitrary metadata (labels, start_time...) | |
For examples, see the custom adapters below. | |
""" | |
@abstractmethod | |
def iter_data(self, slice_element=None): | |
return NotImplementedError | |
@abstractmethod | |
def __len__(self): | |
return NotImplementedError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment