Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import os.path
import kaggle
'''
Downloads Moltean's fruits dataset using kaggle module
(install with 'pip install -r requirements.txt')
if dataset zip file is not found.
'''
dataset = 'moltean/fruits'
dataset_dir = 'tensorflow-inference/fruits-360'
if os.path.isdir(dataset_dir):
print("Found dataset directory, exiting")
exit(0)
print("Dataset not found, using kaggle-api tool for download")
kaggle.api.dataset_download_files(dataset, path="./tensorflow-inference/", unzip=True)
import os.path
import kaggle
'''
Downloads blood-cells dataset using kaggle module (install with 'pip install -r requirements.txt')
if dataset zip file is not found.
'''
dataset = 'paultimothymooney/blood-cells'
dataset_file = 'tensorflow-train/dataset2-master.zip'
if os.path.isfile(dataset_file):
print("Found dataset archive, exiting")
exit(0)
print("Dataset not found, using kaggle-api tool for download")
kaggle.api.dataset_download_files(dataset, path="./tensorflow-train/", unzip=True)
def _download(self):
if not os.path.exists(self.root+'/'):
os.makedirs(self.root+'/')
else:
return
import kaggle
kaggle.api.authenticate()
kaggle.api.dataset_download_files('drgilermo/face-images-with-marked-landmark-points', path=self.root, unzip=True)