(manifest_path, index_file, annot_dir, image_dir, root_dir)
Based on a PASCALVOC index file, creates a manifest csv file.
    If the manifest file already exists, this function will skip writing, unless the
    overwrite argument is set to True.

    Arguments:
        manifest_path (string): path to save the manifest file
        index (string or list): list of images.
        annot_dir (string): directory of annotations
        img_dir (string): directory of images
        root_dir (string): paths will be made relative to this directory
        ext (string, optional): image extension (default=.jpg)
Based on a PASCALVOC index file, creates a manifest csv file.
    If the manifest file already exists, this function will skip writing, unless the
    overwrite argument is set to True.
Based on a PASCALVOC index file creates a manifest csv file . If the manifest file already exists this function will skip writing unless the overwrite argument is set to True .
def create_manifest(manifest_path, index_file, annot_dir, image_dir, root_dir):
    """
    Based on a PASCALVOC index file, creates a manifest csv file.
    If the manifest file already exists, this function will skip writing, unless the
    overwrite argument is set to True.

    Arguments:
        manifest_path (string): path to save the manifest file
        index (string or list): list of images.
        annot_dir (string): directory of annotations
        img_dir (string): directory of images
        root_dir (string): paths will be made relative to this directory
        ext (string, optional): image extension (default=.jpg)
    """
    records = [('@FILE', 'FILE')]
    with open(index_file) as f:
        for img in f:
            tag = img.rstrip(os.linesep)

            image = os.path.join(image_dir, tag + '.jpg')
            annot = os.path.join(annot_dir, tag + '.json')

            assert os.path.exists(image), 'Path {} not found'.format(image)
            assert os.path.exists(annot), 'Path {} not found'.format(annot)

            records.append((os.path.relpath(image, root_dir),
                            os.path.relpath(annot, root_dir)))

    np.savetxt(manifest_path, records, fmt='%s\t%s')
def create_manifest ( manifest_path , index_file , annot_dir , image_dir , root_dir ) : records = [ ( '@FILE' , 'FILE' ) ] with open ( index_file ) as f : for img in f : tag = img . rstrip ( os . linesep ) image = os . path . join ( image_dir , tag + '.jpg' ) annot = os . path . join ( annot_dir , tag + '.json' ) assert os . path . exists ( image ) , 'Path {} not found' . format ( image ) assert os . path . exists ( annot ) , 'Path {} not found' . format ( annot ) records . append ( ( os . path . relpath ( image , root_dir ) , os . path . relpath ( annot , root_dir ) ) ) np . savetxt ( manifest_path , records , fmt = '%s\t%s' )