API details: Module for defining config and downloading data from various sources like kaggle, fastai, github
from nbdev import *
# %nbdev_default_export data.external
# %nbdev_default_export data.external
fname = URLs.PETS.split("/")[-1]
c_key='model'
local_path = URLs.LOCAL_PATH/('model' if c_key=='model' else 'data')/fname
local_path
Config().d.keys()
Config()[c_key]
Config()['data']
URLs.path()
os.environ["FASTAI_HOME"] = str(Config().config_path.absolute())
URLs.path()
URLs.path()
URLs.path()
This is going to be a helper class for downloading Kaggle dataset in required structure
KAGGLEs.path()
URLs.path(URLs.PETS)
URLs.path(URLs.PETS, c_key="data")
KAGGLEs.path(KAGGLEs.SPOOKY_AUTHOR_IDENTIFICATION)
KAGGLEs.path(KAGGLEs.SPOOKY)
KAGGLEs.ktype(KAGGLEs.SPOOKY)
!cat /Landmark2/pdo/.nlphero/config.yml
KAGGLEs.SPOOKY
KAGGLEs.SPOOKY.startswith("kaggle")
is_kaggle = KAGGLEs.SPOOKY.startswith("kaggle")
T = [URLs, KAGGLEs][is_kaggle]
T
URLs
T.path()
c_key='data'
# url = KAGGLEs.SPOOKY
url = URLs.PETS
is_kaggle =url.startswith("kaggle")
T = [URLs, KAGGLEs][is_kaggle]
dest=None
fname = None
default_dest = T.path(url, c_key=c_key).with_suffix('')
dest = default_dest if dest is None else Path(dest)/default_dest.name
fname = Path(fname or T.path(url))
default_dest
dest.parent
fname.suffix
# pd.DataFrame([path.name for path in KAGGLEs.path(c_key='data').ls()])
print("Check")
# loc =os.path.join(os.getenv("NLPHERO_HOME"), "data")
# if Path(loc).exists(): print(list_ds(loc))
clstypes = "Sarah Shahi", "Mercedes Masohn", "Jeffrey Dean Morgan", "Javier Bardem", "Benicio Del Toro", "Brad Pitt"
dest = "DoppelgangerMixed"
count=150