diff options
Diffstat (limited to 'cli/app')
| -rw-r--r-- | cli/app/commands/process/fetch.py | 20 | ||||
| -rw-r--r-- | cli/app/settings/app_cfg.py | 37 |
2 files changed, 57 insertions, 0 deletions
diff --git a/cli/app/commands/process/fetch.py b/cli/app/commands/process/fetch.py new file mode 100644 index 0000000..a558d94 --- /dev/null +++ b/cli/app/commands/process/fetch.py @@ -0,0 +1,20 @@ +import click + +from app.utils import click_utils +from app.settings import app_cfg + +@click.command('') +# @click.option('-i', '--input', 'opt_dir_in', required=True, +# help='Path to input image glob directory') +# @click.option('-r', '--recursive', 'opt_recursive', is_flag=True) +@click.pass_context +def cli(ctx): + """ + Converts directory of images to BigGAN* vectors + """ + + # ------------------------------------------------ + # imports + + # app_cfg.MODELZOO_CFG + pass diff --git a/cli/app/settings/app_cfg.py b/cli/app/settings/app_cfg.py new file mode 100644 index 0000000..fe65458 --- /dev/null +++ b/cli/app/settings/app_cfg.py @@ -0,0 +1,37 @@ +import os +from os.path import join +import collections +import logging + +from dotenv import load_dotenv +import yaml + +from app.models import types +from pathlib import Path + +import codecs +codecs.register(lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None) + +# ----------------------------------------------------------------------------- +# Click config +# ----------------------------------------------------------------------------- + +CLICK_GROUPS = { + 'process': 'commands/process', +} + +# ----------------------------------------------------------------------------- +# File I/O +# ----------------------------------------------------------------------------- + +SELF_CWD = os.path.dirname(os.path.realpath(__file__)) # Script CWD +DIR_APP = str(Path(SELF_CWD).parent.parent.parent) + +FP_MODELZOO = join(DIR_APP, 'modelzoo/modelzoo.yaml') + +# ----------------------------------------------------------------------------- +# Model config +# ----------------------------------------------------------------------------- + +with open(FP_MODELZOO, 'r') as fp: + MODELZOO_CFG = yaml.load(fp, Loader=yaml.Loader) |
