kittendev's picture
Upload 176 files
c20a1af verified
raw
history blame contribute delete
574 Bytes
# Copyright (C) 2020 * Ltd. All rights reserved.
# author : Sanghyeon Jo <[email protected]>
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.')