geomfum.dataset package#

Submodules#

geomfum.dataset.notebook module#

Datasets for noteboos/docs.

class geomfum.dataset.notebook.NotebooksDataset(data_dir=None, load_at_startup=False)[source]#

Bases: object

Dataset to use within notebooks.

Parameters:
  • data_dir (str) – Directory where to store/access data.

  • load_at_startup (bool) – Whether to (down)load files at startup.

get_filename(index)[source]#

Get filename after (down)loading.

Uses cached file if already in the system.

Parameters:

index (str) – File index in the dataset.

Returns:

file_path (str) – File name including directory.

get_filenames()[source]#

Get filenames after (down)loading.

Uses cached files if already in the system.

Returns:

file_paths (list[str]) – File names including directory.

geomfum.dataset.torch module#

Shape dataset for PyTorch.

class geomfum.dataset.torch.PairsDataset(dataset=None, pair_mode='all', pairs_ratio=100, device=None)[source]#

Bases: Dataset

Dataset of pairs of shapes.

Parameters:
  • dataset (torch.utils.data.Dataset or list) – Preloaded dataset or list of shape data objects.

  • pair_mode (str, optional) – Strategy to generate pairs. Options: ‘all’, ‘random’. Default is ‘all’.

  • n_pairs (int, optional) – Number of random pairs to generate if pair_mode is ‘random’. Default is 100.

  • device (torch.device, optional) – Device to move the data to. If None, uses CUDA if available, else CPU.

generate_all_pairs()[source]#

Generate all possible pairs of shapes.

generate_random_pairs(pairs_ratio=0.5)[source]#

Generate random pairs of shapes.

Parameters:

pairs_ratio (float) – Ratio of pairs to generate compared to the total number of possible pairs. Default is 0.5, meaning half of the possible pairs will be generated.

class geomfum.dataset.torch.ShapeDataset(dataset_dir, spectral=False, distances=False, correspondences=True, k=200, device=None)[source]#

Bases: Dataset

ShapeDataset for loading and preprocessing shape data.

Parameters:
  • dataset_dir (str) – Path to the directory containing the dataset. We assume the dataset directory to have a subfolder shapes, for shapes, corr, for correspondences and dist, for chaced distance matrices.

  • spectral (bool) – Whether to compute the spectral features.

  • distances (bool) – Whether to compute geodesic distance matrices. For computational reasons, these are not computed on the fly, but rather loaded from a precomputed .mat file.

  • k (int) – Number of eigenvectors to use for the spectral features.

  • device (torch.device, optional) – Device to move the data to.

Module contents#

Datasets.