Ejemplo n.º 1
0
    def download(self):
        print("Downloading {} dataset.".format(self.name))
        url = self.url.format(self.name)
        download_file(url, self.path, self.name + ".zip")

        # Datasets are zipped in a folder: unpack them
        parent = self.path
        subfolder = osp.join(self.path, self.name)
        for filename in os.listdir(subfolder):
            shutil.move(osp.join(subfolder, filename),
                        osp.join(parent, filename))
        os.rmdir(subfolder)

        x, adj, y, mask_tr, mask_va, mask_te = preprocess_data(
            self.path, self.name)

        # Save pre-processed data
        npz_file = osp.join(self.path, self.name) + ".npz"
        adj = adj.tocoo()
        np.savez(
            npz_file,
            x=x,
            adj_data=adj.data,
            adj_row=adj.row,
            adj_col=adj.col,
            adj_shape=adj.shape,
            y=y,
            mask_tr=mask_tr,
            mask_va=mask_va,
            mask_te=mask_te,
        )
Ejemplo n.º 2
0
    def download(self):
        print('Downloading {} dataset{}.'
              .format(self.name, ' (clean)' if self.clean else ''))
        url = '{}/{}.zip'.format(self.url_clean if self.clean else self.url, self.name)
        download_file(url, self.path, self.name + '.zip')

        # Datasets are zipped in a folder: unpack them
        parent = self.path
        subfolder = osp.join(self.path, self.name)
        for filename in os.listdir(subfolder):
            shutil.move(osp.join(subfolder, filename), osp.join(parent, filename))
        os.rmdir(subfolder)
Ejemplo n.º 3
0
    def download(self):
        print("Downloading ModelNet{} dataset.".format(self.name))
        url = self.url[self.name]
        download_file(url, self.path, "ModelNet" + self.name + ".zip")

        # Datasets are zipped in a folder: unpack them
        parent = self.path
        subfolder = osp.join(self.path, "ModelNet" + self.name)
        for filename in os.listdir(subfolder):
            shutil.move(osp.join(subfolder, filename),
                        osp.join(parent, filename))
        os.rmdir(subfolder)
        shutil.rmtree(osp.join(self.path, "__MACOSX"), ignore_errors=True)
Ejemplo n.º 4
0
 def download(self):
     print("Downloading ModelNet{} dataset.".format(self.name))
     url = self.url[self.name]
     download_file(url, self.path, "ModelNet" + self.name + ".zip")
     shutil.rmtree(osp.join(self.path, "__MACOSX"), ignore_errors=True)
Ejemplo n.º 5
0
 def download(self):
     print('Downloading ModelNet{} dataset.'.format(self.name))
     url = self.url[self.name]
     download_file(url, self.path, 'ModelNet' + self.name + '.zip')
     shutil.rmtree(osp.join(self.path, '__MACOSX'), ignore_errors=True)