def inject_fake_data(self, tmpdir): testfolder = os.path.join(tmpdir, "NMNIST/Train/1/") os.makedirs(testfolder, exist_ok=True) filename = "image_0006.bin" download_url(url=base_url + filename, root=testfolder, filename="24901.bin") return {"n_samples": 1}
def inject_fake_data(self, tmpdir): testfolder = os.path.join(tmpdir, "ASLDVS/a") os.makedirs(testfolder, exist_ok=True) filename = "a_0244.mat" download_url(url=base_url + filename, root=testfolder, filename=filename) return {"n_samples": 1}
def inject_fake_data(self, tmpdir): testfolder = os.path.join(tmpdir, "NCALTECH101/Caltech101/airplanes/") os.makedirs(testfolder, exist_ok=True) filename = "image_0006.bin" download_url(url=base_url + filename, root=testfolder, filename=filename) return {"n_samples": 1}
def download(self): for (filename, md5_hash) in self.resources[self.scene]: download_url( url=os.path.join(self.base_url, self.scene, filename), root=os.path.join(self.location_on_system, self.scene), filename=filename, md5=md5_hash, )
def download(self): for recording in self.selection: download_url( self.base_url + recording + ".bag", self.location_on_system, filename=recording + ".bag", md5=self.recordings[recording], )
def download(self): for recording in self.recordings: for filename, md5_hash in recording: download_url( self.base_url + filename, self.location_on_system, filename=filename, md5=md5_hash, )
def _check_exists(self): for recording in self.selection: file_folder = os.path.join(self.location_on_system, recording) os.makedirs(file_folder, exist_ok=True) for filename in self.filenames: if check_integrity( os.path.join(file_folder, f"{recording}-{filename}")): continue url = f"{self.base_url}{recording}/{recording}-{filename}" if filename.endswith("tar.gz"): download_and_extract_archive(url, file_folder) else: download_url(url, file_folder)
def _check_exists(self): for recording in self.selection: scene_url = f"{self.base_url}{self.train_or_test}/{recording}/{recording}_" for filename, extension in self.filenames: if check_integrity( os.path.join( self.location_on_system, recording, filename, f"{recording}_{filename + extension}", )): continue file_folder = os.path.join(self.location_on_system, recording, filename) os.makedirs(file_folder, exist_ok=True) url = scene_url + filename + extension if extension == ".zip": download_and_extract_archive(url, file_folder) else: download_url(url, file_folder)