-
Notifications
You must be signed in to change notification settings - Fork 11
/
clotho_dataset.py
51 lines (37 loc) · 1.53 KB
/
clotho_dataset.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdout
from datetime import datetime
from loguru import logger
from tools.argument_parsing import get_argument_parser
from tools.file_io import load_settings_file
from processes.dataset import create_dataset
__author__ = 'Konstantinos Drossos -- Tampere University'
__docformat__ = 'reStructuredText'
__all__ = ['main']
def main():
logger.remove()
logger.add(stdout, format='{level} | [{time:HH:mm:ss}] {name} -- {message}.',
level='INFO', filter=lambda record: record['extra']['indent'] == 1)
logger.add(stdout, format=' {level} | [{time:HH:mm:ss}] {name} -- {message}.',
level='INFO', filter=lambda record: record['extra']['indent'] == 2)
main_logger = logger.bind(indent=1)
args = get_argument_parser().parse_args()
if not args.verbose:
main_logger.info('Verbose if off. Not logging messages')
logger.disable('__main__')
logger.disable('processes')
main_logger.info(datetime.now().strftime('%Y-%m-%d %H:%M'))
main_logger.info('Loading settings')
settings = load_settings_file(args.config_file)
settings_dataset = settings['dataset_creation_settings']
settings_files_io = settings['dirs_and_files']
main_logger.info('Settings loaded')
main_logger.info('Starting Clotho dataset creation')
create_dataset(
settings_dataset=settings_dataset,
settings_dirs_and_files=settings_files_io)
main_logger.info('Dataset created')
if __name__ == '__main__':
main()
# EOF