Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_cifar():
if os.path.exists(Path.home()/'efs_mount_point/cifar10.tgz'):
shutil.copy2(Path.home()/'efs_mount_point/cifar10.tgz', 'data/cifar10.tgz')
else:
cifar_url = 'http://files.fast.ai/data/cifar10.tgz' # faster download
# cifar_url = 'http://pjreddie.com/media/files/cifar.tgz'
io.get_data(cifar_url, 'data/cifar10.tgz')
def download_cifar10(data_path):
# (AS) TODO: put this into the fastai library
def untar_file(file_path, save_path):
if file_path.endswith('.tar.gz') or file_path.endswith('.tgz'):
obj = tarfile.open(file_path)
obj.extractall(save_path)
obj.close()
os.remove(file_path)
cifar_url = 'http://files.fast.ai/data/cifar10.tgz' # faster download
# cifar_url = 'http://pjreddie.com/media/files/cifar.tgz'
io.get_data(cifar_url, args.data+'/cifar10.tgz')
untar_file(data_path+'/cifar10.tgz', data_path)
# Loader expects train and test folders to be outside of cifar10 folder
shutil.move(data_path+'/cifar10/train', data_path)
shutil.move(data_path+'/cifar10/test', data_path)
def download_cifar10(data_path):
# (AS) TODO: put this into the fastai library
def untar_file(file_path, save_path):
if file_path.endswith('.tar.gz') or file_path.endswith('.tgz'):
obj = tarfile.open(file_path)
obj.extractall(save_path)
obj.close()
os.remove(file_path)
cifar_url = 'http://files.fast.ai/data/cifar10.tgz' # faster download
# cifar_url = 'http://pjreddie.com/media/files/cifar.tgz'
io.get_data(cifar_url, args.data+'/cifar10.tgz')
untar_file(data_path+'/cifar10.tgz', data_path)
# Loader expects train and test folders to be outside of cifar10 folder
shutil.move(data_path+'/cifar10/train', data_path)
shutil.move(data_path+'/cifar10/test', data_path)