# Copyright (C) 2020 * Ltd. All rights reserved. # author : Sanghyeon Jo import os import random import argparse import numpy as np def create_directory(path): if not os.path.isdir(path): os.makedirs(path) return path def str2bool(v): if isinstance(v, bool): return v if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Boolean value expected.')