def _download(self): paths = [ os.path.join(self.data_path, "GTSRB", "Final_Training"), os.path.join(self.data_path, "GTSRB", "Final_Test"), os.path.join(self.data_path, "GT-final_test.csv") ] zips = [ os.path.join(self.data_path, "GTSRB_Final_Training_Images.zip"), os.path.join(self.data_path, "GTSRB_Final_Test_Images.zip"), os.path.join(self.data_path, "GTSRB_Final_Test_GT.zip") ] urls = [ self.train_images_url, self.test_images_url, self.test_gt_url ] for p, z, u in zip(paths, zips, urls): if not os.path.exists(p): if not os.path.exists(z): print("Downloading images archive...", end=' ') download(u, self.data_path) print('Done!') print('Extracting archive...', end=' ') unzip(z) print('Done!')
def _download(self): if not os.path.exists( os.path.join(self.data_path, "Animals_with_Attributes2")): zip_path = os.path.join(self.data_path, "AwA2-data.zip") if not os.path.exists(zip_path): print("Downloading zip images archive...", end=' ') download(self.images_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') unzip(zip_path) print('Done!') if not os.path.exists(os.path.join(self.data_path, "xlsa17")): zip_path = os.path.join(self.data_path, "xlsa17.zip") if not os.path.exists(zip_path): print("Downloading zip split archive...", end=' ') download(self.split_v2_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') unzip(zip_path) print('Done!')
def _download(self): if not os.path.exists(os.path.join(self.data_path, "images")): archive_images_path = os.path.join(self.data_path, "images.tar.gz") if not os.path.exists(archive_images_path): print("Downloading images archive...", end=' ') image_url = os.path.join(self.base_url, "images.tar.gz") download(image_url, self.data_path) print('Done!') print('Extracting images archive...', end=' ') untar(archive_images_path) print('Done!') if not os.path.exists(os.path.join(self.data_path, "annotations")): archive_annotations_path = os.path.join(self.data_path, "annotations.tar.gz") if not os.path.exists(archive_annotations_path): print("Downloading annotations archive...", end=' ') annotations_url = os.path.join(self.base_url, "annotations.tar.gz") download(annotations_url, self.data_path) print('Done!') print('Extracting annotations archive...', end=' ') untar(archive_annotations_path) print('Done!')
def _download(self): archive_path = os.path.join(self.data_path, "dtd-r1.0.1.tar.gz") if not os.path.exists(archive_path): print("Downloading DTD dataset...") download.download(self.url, self.data_path) if not os.path.exists(os.path.join(self.data_path, "dtd")): print("Uncompressing images...") download.untar(archive_path)
def _download(self): path = os.path.join(self.data_path, "tiny-imagenet-200") if not os.path.exists(f"{path}.zip"): download(self.url, self.data_path) if not os.path.exists(path): unzip(f"{path}.zip") print("TinyImagenet is downloaded.")
def _download(self): path = os.path.join(self.data_path, "Stream-51") if not os.path.exists(f"{path}.zip"): download(self.url, self.data_path) if not os.path.exists(path): unzip(f"{path}.zip") print("Stream51 downloaded.")
def _download(self): super()._download() if self.train_subset is None: self.train_subset = os.path.join(self.train_folder, "train_100.txt") download(self.train_subset_url, self.train_folder) if self.test_subset is None: self.test_subset = os.path.join(self.test_folder, "val_100.txt") download(self.test_subset_url, self.test_folder)
def _download(self): if not os.path.exists(os.path.join(self.data_path, "2750")): zip_path = os.path.join(self.data_path, "EuroSAT.zip") if not os.path.exists(zip_path): print("Downloading zip images archive...", end=' ') download(self.images_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') unzip(zip_path) print('Done!')
def _download(self): super()._download() filename = "val_100.txt" self.subset_url = self.test_subset_url if self.train: filename = "train_100.txt" self.subset_url = self.train_subset_url if self.data_subset is None: self.data_subset = os.path.join(self.data_path, filename) download(self.subset_url, self.data_path)
def _download(self): if not os.path.exists(os.path.join(self.data_path, "SUN397")): archive_path = os.path.join(self.data_path, "SUN397.tar.gz") if not os.path.exists(archive_path): print("Downloading images archive...", end=' ') download(self.images_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') untar(archive_path) print('Done!')
def _download(self): if not os.path.exists( os.path.join(self.data_path, "fgvc-aircraft-2013b")): archive_path = os.path.join(self.data_path, "fgvc-aircraft-2013b.tar.gz") if not os.path.exists(archive_path): print(f"Downloading archive ...", end=" ") download(self.url, self.data_path) print('Done!') print(f"Extracting archive...", end=" ") untar(archive_path) print("Done!")
def _download(self): if not os.path.exists( os.path.join(self.data_path, "VOCdevkit", "VOC2007")): archive_path = os.path.join(self.data_path, "VOCtrainval_06-Nov-2007.tar") if not os.path.exists(archive_path): print(f"Downloading archive ...", end=" ") download.download(self.url, self.data_path) print('Done!') print(f"Extracting archive...", end=" ") download.untar(archive_path) print("Done!")
def _download(self): if os.path.exists(os.path.join(self.data_path, "core50_128x128")): print("Dataset already extracted.") else: path = download.download(self.data_url, self.data_path) download.unzip(path) print("Dataset extracted.") if os.path.exists(os.path.join(self.data_path, "batches_filelists_NICv2.zip")): print("Split info already downloaded.") else: path = download.download(self.splits_url, self.data_path) download.unzip(path) print("Split info extracted.")
def _download(self): if os.path.exists(os.path.join(self.data_path, "core50_128x128")): print("Dataset already extracted.") else: path = download.download(self.data_url, self.data_path) download.unzip(path) print("Dataset extracted.") split_path = os.path.join(self.data_path, "core50_train.csv") if self.train_image_ids is None and os.path.exists(split_path): self.train_image_ids = split_path print("Train/split already downloaded.") elif self.train_image_ids is None: print("Downloading train/test split.") self.train_image_ids = download.download(self.train_ids_url, self.data_path)
def _download(self): for url in self.urls: base_file_name = url.split("/")[-1].split(".")[-2] path = os.path.join(self.data_path, base_file_name) if not os.path.exists(path): zip_path = path + ".zip" if not os.path.exists(zip_path): print(f"Downloading {base_file_name}...") download(url, self.data_path) print('Extracting archive...', end=' ') unzip(zip_path) print('Done!')
def _download(self): if os.path.exists(os.path.join(self.data_path, "multinli_1.0")): print("Dataset already extracted.") else: path = download.download(self.data_url, self.data_path) download.unzip(path) print("Dataset extracted.")
def _download(self): # Downloading images if not os.path.exists(os.path.join(self.data_path, "VOCdevkit")): path = os.path.join(self.data_path, "VOCtrainval_11-May-2012.tar") if not os.path.exists(path): print("Downloading Pascal VOC segmentation maps...") download.download(self.data_url, self.data_path) print("Uncompressing images...") download.untar(path) # Downloading segmentation maps if not os.path.exists(os.path.join(self.data_path, "SegmentationClassAug")): path = os.path.join(self.data_path, "SegmentationClassAug.zip") if not os.path.exists(path): print("Downloading Pascal VOC segmentation maps...") download.download(self.segmentation_url, self.data_path) print("Uncompressing segmentation maps...") download.unzip(path) # Downloading train/val/test indexes if not os.path.exists(os.path.join(self.data_path, "list")): path = os.path.join(self.data_path, "list.zip") if not os.path.exists(path): print("Downloading Pascal VOC train/val/test indexes...") download.download(self.split_url, self.data_path) print("Uncompressing train/val/test indexes...") download.unzip(path)
def _download(self): folders = ["devkit", "cars_train", "cars_test"] archives = ["car_devkit.tgz", "cars_train.tgz", "cars_test.tgz"] urls = [self.devkit_url, self.train_url, self.test_url] for f, a, u in zip(folders, archives, urls): if not os.path.exists(os.path.join(self.data_path, f)): archive_path = os.path.join(self.data_path, a) if not os.path.exists(archive_path): print(f"Downloading archive {a} ...", end=" ") download(u, self.data_path) print('Done!') print(f"Extracting archive... {a}->{f}", end=" ") untar(archive_path) print("Done!") if not os.path.exists( os.path.join(self.data_path, "cars_test_annos_withlabels.mat")): download(self.test_labels_url, self.data_path)
def _download(self): global _DOWNLOAD_FOLDER _DOWNLOAD_FOLDER = os.path.join(self.data_path, "images") os.makedirs(_DOWNLOAD_FOLDER, exist_ok=True) if not os.path.exists(os.path.join(self.data_path, "birdsnap")): archive_path = os.path.join(self.data_path, "birdsnap.tgz") if not os.path.exists(archive_path): print("Downloading archive of metadata...", end=' ') download(self.meta_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') untar(archive_path) print('Done!') with open(os.path.join(self.data_path, "birdsnap", "images.txt")) as f: data = f.readlines()[1:] good_images = 0 print(f"Downloading or checking {len(data)} images...") pb = ProgressBar() with ThreadPool(10) as pool: for processed_data in pool.imap_unordered(_download_images, data): pb.update(None, 1, len(data)) if processed_data is None: continue good_images += 1 pb.end(len(data)) if good_images != len(data): warnings.warn( f"{len(data)-good_images} couldn't be downloaded among {len(data)}." )
def _download(self): if not os.path.exists( os.path.join(self.data_path, "eccv_18_all_images_sm")): tar_path = os.path.join(self.data_path, "eccv_18_all_images_sm.tar.gz") if not os.path.exists(tar_path): print("Downloading images archive...", end=" ") download(self.images_url, self.data_path) print("Done!") print('Extracting archive...', end=' ') untar(tar_path) print('Done!') if not os.path.exists( os.path.join(self.data_path, "caltech_images_20210113.json")): zip_path = os.path.join(self.data_path, "caltech_camera_traps.json.zip") if not os.path.exists(zip_path): print("Downloading json archive...", end=" ") download(self.json_url, self.data_path) print("Done!") print('Extracting archive...', end=' ') unzip(zip_path) print('Done!')
def _download(self): if not os.path.exists(os.path.join(self.data_path, "jpg")): archive_images_path = os.path.join(self.data_path, "102flowers.tgz") if not os.path.exists(archive_images_path): print("Downloading images archive...", end=' ') image_url = os.path.join(self.base_url, "102flowers.tgz") download(image_url, self.data_path) print('Done!') print('Extracting archive...', end=' ') untar(archive_images_path) print('Done!') # Downloading label file if not os.path.exists(os.path.join(self.data_path, "imagelabels.mat")): label_url = os.path.join(self.base_url, "imagelabels.mat") download(label_url, self.data_path) # Downloading split file if not os.path.exists(os.path.join(self.data_path, "setid.mat")): split_url = os.path.join(self.base_url, "setid.mat") download(split_url, self.data_path)
def _download(self): path = os.path.join(self.data_path, "tiny-imagenet-200") if not os.path.exists(path): if not os.path.exists(f"{path}.zip"): download(self.url, self.data_path) unzip(f"{path}.zip")