collection/collectionMaker.py
def read_collection(clc_name=None, clc_dir=None, raw_data_path=None, field_name=None, field_id=None, rgb_ext=None,
                    gt_ext=None, file_ext=None, files=None, force_run=False):
    """
    Read and initialize a collection from a directory, try to create one if it does not exists
    :param clc_name: name of the collection
    :param clc_dir: directory to the collection
    :return: the collection object, assertion error if no process hasn't completed

    :param raw_data_path: path to where the data are stored
    :param field_name: could be name of the cities, or other prefix of the images
    :param field_id: could be id of the tiles, or other suffix of the images
    :param rgb_ext: name extensions that indicates the images are not ground truth, use ',' to separate if you have
                    multiple extensions
    :param gt_ext: name extensions that indicates the images are ground truth, you can only have at most one ground
                   truth extension
    :param file_ext: extension of the files, use ',' to separate if you have multiple extensions, if all the files
                     have the same extension, you only need to specify one
    :param files: files in the raw_data_path, can be specified by user to exclude some of the raw files, if it is
                  None, all files will be found automatically
    :param force_run: force run the collection maker even if it already exists
    """
    if clc_dir is None:
        assert clc_name is not None
        clc_dir = ersa_utils.get_block_dir('data', ['collection', clc_name])
    # check if finish
    if processBlock.BasicProcess('collection_maker', clc_dir).check_finish():
        # read metadata
        meta_data = ersa_utils.load_file(os.path.join(clc_dir, 'meta.pkl'))
        # create collection
        cm = CollectionMaker(meta_data['raw_data_path'], meta_data['field_name'], meta_data['field_id'],
                             meta_data['rgb_ext'], meta_data['gt_ext'], meta_data['file_ext'],
                             meta_data['files'], meta_data['clc_name'], force_run=force_run)
        return cm
    else:
        # try to create the collection
        return CollectionMaker(raw_data_path, field_name, field_id, rgb_ext, gt_ext, file_ext, files, clc_name,
                               force_run)

    Read and initialize a collection from a directory, try to create one if it does not exists
    :param clc_name: name of the collection
    :param clc_dir: directory to the collection
    :return: the collection object, assertion error if no process hasn't completed

    :param raw_data_path: path to where the data are stored
    :param field_name: could be name of the cities, or other prefix of the images
    :param field_id: could be id of the tiles, or other suffix of the images
    :param rgb_ext: name extensions that indicates the images are not ground truth, use ',' to separate if you have
                    multiple extensions
    :param gt_ext: name extensions that indicates the images are ground truth, you can only have at most one ground
                   truth extension
    :param file_ext: extension of the files, use ',' to separate if you have multiple extensions, if all the files
                     have the same extension, you only need to specify one
    :param files: files in the raw_data_path, can be specified by user to exclude some of the raw files, if it is
                  None, all files will be found automatically
    :param force_run: force run the collection maker even if it already exists
    
Read and initialize a collection from a directory, try to create one if it does not exists
Read and initialize a collection from a directory try to create one if it does not exists
def read_collection(clc_name=None, clc_dir=None, raw_data_path=None, field_name=None, field_id=None, rgb_ext=None,
                    gt_ext=None, file_ext=None, files=None, force_run=False):
    if clc_dir is None:
        assert clc_name is not None
        clc_dir = ersa_utils.get_block_dir('data', ['collection', clc_name])
    if processBlock.BasicProcess('collection_maker', clc_dir).check_finish():
        meta_data = ersa_utils.load_file(os.path.join(clc_dir, 'meta.pkl'))
        cm = CollectionMaker(meta_data['raw_data_path'], meta_data['field_name'], meta_data['field_id'],
                             meta_data['rgb_ext'], meta_data['gt_ext'], meta_data['file_ext'],
                             meta_data['files'], meta_data['clc_name'], force_run=force_run)
        return cm
    else:
        return CollectionMaker(raw_data_path, field_name, field_id, rgb_ext, gt_ext, file_ext, files, clc_name,
                               force_run)
def read_collection ( clc_name = None , clc_dir = None , raw_data_path = None , field_name = None , field_id = None , rgb_ext = None , gt_ext = None , file_ext = None , files = None , force_run = False ) : if clc_dir is None : assert clc_name is not None clc_dir = ersa_utils . get_block_dir ( 'data' , [ 'collection' , clc_name ] ) if processBlock . BasicProcess ( 'collection_maker' , clc_dir ) . check_finish ( ) : meta_data = ersa_utils . load_file ( os . path . join ( clc_dir , 'meta.pkl' ) ) cm = CollectionMaker ( meta_data [ 'raw_data_path' ] , meta_data [ 'field_name' ] , meta_data [ 'field_id' ] , meta_data [ 'rgb_ext' ] , meta_data [ 'gt_ext' ] , meta_data [ 'file_ext' ] , meta_data [ 'files' ] , meta_data [ 'clc_name' ] , force_run = force_run ) return cm else : return CollectionMaker ( raw_data_path , field_name , field_id , rgb_ext , gt_ext , file_ext , files , clc_name , force_run )
Read and initialize a collection from a directory, try to create one if it does not exists
Read and initialize a collection from a directory try to create one if it does not exists
"""
    Read and initialize a collection from a directory, try to create one if it does not exists
    :param clc_name: name of the collection
    :param clc_dir: directory to the collection
    :return: the collection object, assertion error if no process hasn't completed

    :param raw_data_path: path to where the data are stored
    :param field_name: could be name of the cities, or other prefix of the images
    :param field_id: could be id of the tiles, or other suffix of the images
    :param rgb_ext: name extensions that indicates the images are not ground truth, use ',' to separate if you have
                    multiple extensions
    :param gt_ext: name extensions that indicates the images are ground truth, you can only have at most one ground
                   truth extension
    :param file_ext: extension of the files, use ',' to separate if you have multiple extensions, if all the files
                     have the same extension, you only need to specify one
    :param files: files in the raw_data_path, can be specified by user to exclude some of the raw files, if it is
                  None, all files will be found automatically
    :param force_run: force run the collection maker even if it already exists
    """ # check if finish # read metadata # create collection # try to create the collection
the collection object, assertion error if no process hasn't completed
the collection object assertion error if no process hasn ' t completed
clc_name
name of the collection
name of the collection
clc_dir
directory to the collection
directory to the collection
raw_data_path
path to where the data are stored
path to where the data are stored
field_name
could be name of the cities, or other prefix of the images
could be name of the cities or other prefix of the images
field_id
could be id of the tiles, or other suffix of the images
could be id of the tiles or other suffix of the images
rgb_ext
name extensions that indicates the images are not ground truth, use ',' to separate if you have
multiple extensions
name extensions that indicates the images are not ground truth use ' ' to separate if you have multiple extensions
gt_ext
name extensions that indicates the images are ground truth, you can only have at most one ground
truth extension
name extensions that indicates the images are ground truth you can only have at most one ground truth extension
file_ext
extension of the files, use ',' to separate if you have multiple extensions, if all the files
have the same extension, you only need to specify one
extension of the files use ' ' to separate if you have multiple extensions if all the files have the same extension you only need to specify one
files
files in the raw_data_path, can be specified by user to exclude some of the raw files, if it is
None, all files will be found automatically
files in the raw_data_path can be specified by user to exclude some of the raw files if it is None all files will be found automatically
force_run
force run the collection maker even if it already exists
force run the collection maker even if it already exists