(img_iter, src_dir, side, truncate=None)
Args:
            path (str): location of a src file containing image paths
            src_dir (str): location of source images
            side (str): 'src' or 'tgt'
            truncate: maximum img size ((0,0) or None for unlimited)

        Yields:
            a dictionary containing image data, path and index for each line.
Args:
            path (str): location of a src file containing image paths
            src_dir (str): location of source images
            side (str): 'src' or 'tgt'
            truncate: maximum img size ((0,0) or None for unlimited)
Args : path ( str ) : location of a src file containing image paths src_dir ( str ) : location of source images side ( str ) : src or tgt truncate : maximum img size (( 0 0 ) or None for unlimited )
def make_examples(img_iter, src_dir, side, truncate=None):
        """
        Args:
            path (str): location of a src file containing image paths
            src_dir (str): location of source images
            side (str): 'src' or 'tgt'
            truncate: maximum img size ((0,0) or None for unlimited)

        Yields:
            a dictionary containing image data, path and index for each line.
        """
        assert (src_dir is not None) and os.path.exists(src_dir), \
            'src_dir must be a valid directory if data_type is img'

        for index, (img, filename) in enumerate(img_iter):
            if truncate and truncate != (0, 0):
                if not (img.size(1) <= truncate[0]
                        and img.size(2) <= truncate[1]):
                    continue

            example_dict = {side: img,
                            side + '_path': filename,
                            'indices': index}
            yield example_dict
def make_examples ( img_iter , src_dir , side , truncate = None ) : assert ( src_dir is not None ) and os . path . exists ( src_dir ) , 'src_dir must be a valid directory if data_type is img' for index , ( img , filename ) in enumerate ( img_iter ) : if truncate and truncate != ( 0 , 0 ) : if not ( img . size ( 1 ) <= truncate [ 0 ] and img . size ( 2 ) <= truncate [ 1 ] ) : continue example_dict = { side : img , side + '_path' : filename , 'indices' : index } yield example_dict