Skip to content
Snippets Groups Projects
Select Git revision
  • 588806352b6029a55c0b223b446eb95f0c35b6cb
  • main default protected
2 results

get_json_file_YOLO.py

Blame
  • ci_config.py 1.58 KiB
    # -*- coding: utf-8 -*-
    """
        Create configuration files for continuous integration.
    
    .. moduleauthor:: Valentin Emiya
    """
    from configparser import ConfigParser
    from pathlib import Path
    import os
    import scipy as sp
    
    from yafe.utils import ConfigParser as YafeConfigParser
    
    from tffpy.utils import get_config_file, generate_config
    
    if __name__ == '__main__':
        print(sp.__version__)
        config_file = get_config_file()
        if not config_file.exists():
            generate_config()
            config = ConfigParser()
            config.read(config_file)
            print(len(Path(__file__).absolute().parents))
            print(list(Path(__file__).absolute().parents))
            data_path = Path(__file__).absolute().parents[3] / 'data'
            print('Data path:', str(data_path))
            config.set('DATA', 'data_path', str(data_path))
            config.write(open(config_file, 'w'))
    
        yafe_config_file = YafeConfigParser._config_path
        print(yafe_config_file)
        if not yafe_config_file.exists():
            yafe_user_path = Path(os.path.expanduser('~')) / 'yafe_user_path'
            yafe_logger_path = Path(os.path.expanduser('~')) / 'yafe_logger_path'
            print(yafe_user_path)
            print(yafe_logger_path)
            yafe_user_path.mkdir(parents=True, exist_ok=True)
            yafe_logger_path.mkdir(parents=True, exist_ok=True)
            YafeConfigParser.generate_config()
            yafe_config_parser = YafeConfigParser()
            yafe_config_parser.set('USER', 'data_path', str(yafe_user_path))
            yafe_config_parser.set('LOGGER', 'path', str(yafe_logger_path))
            yafe_config_parser.write(open(yafe_config_file, 'w'))