name = "Market-1501-v15.09.15"
url = "http://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/"+name+".zip"
root = osp.expanduser("~/.mxnet/datasets")
if not os.path.exists(root):
os.mkdir(root)
fpath = osp.join(root, name+".zip")
exdir = osp.join(root, name)
if os.path.exists(fpath):
After Change
def main():
args = parse_args()
name = "Market-1501-v15.09.15"
url = "http://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/{name}.zip".format(name=name)
root = osp.expanduser(args.download_dir)
makedirs(root)
fpath = osp.join(root, name + ".zip")
exdir = osp.join(root, name)
if not osp.exists(fpath) and not osp.isdir(exdir) and args.no_download:
raise ValueError(("{} dataset archive not found, make sure it is present."
" Or you should not disable "--no-download" to grab it".format(fpath)))
// Download by default
if not args.no_download:
print("Downloading dataset")
download(url, fpath, overwrite=False)
print("Dataset downloaded")
// Extract dataset if fresh copy downloaded or existing archive is yet to be extracted
if not args.no_download or not osp.isdir(exdir):
extract(fpath, root)
make_list(exdir)