source.py
1 from interface import Interface, implements 2 3 # a Source knows where to grab the raw data from and returns Frame objects 4 # eg: DirectoryFileSource grab all files from a dir and also a map from file_path to label_path to grab labels from 5 # Loads all files and labels into memory (not images) 6 class Source(Interface): 7 8 def __getitem__(self,index): 9 raise NotImplementedError 10 11 def __next__(self): 12 raise NotImplementedError 13 14 def __len__(self): 15 raise NotImplementedError 16 17 def __iter__(self): 18 raise NotImplementedError