emmi_inference.datasets.shapenet¶
WARNING
This file is a 1:1 duplicate from the tutorial folder, except getitem_grid_pos was removed to enable direct
indexing over the dataset.
It is here to avoid installation of a tutorial as a package and keep it isolated.
Classes¶
Normalization statistics for the ShapeNet Car dataset. |
|
Dataset implementeation for ShapeNet Car. Currently, supports the following properties: |
Module Contents¶
- class emmi_inference.datasets.shapenet.ShapeNetCarStats¶
Normalization statistics for the ShapeNet Car dataset. These statistics are used to normalize the data during training and evaluation.
- class emmi_inference.datasets.shapenet.ShapeNetCarDataset(root, split, position_scale=None, grid_resolution=None, num_repeats=1, **kwargs)¶
Bases:
ksuit.data.DatasetDataset implementeation for ShapeNet Car. Currently, supports the following properties: - position of car surface points - pressure at the surface points - normals at the surface points - positions of surrounding volume of the car - velocity at the volume points - normals at the volume points, pointing towards the car body - SDF at the volume points, w.r.t. the car body - grid positions for GINO encoder
- Parameters:
root (str) – root path of the dataset. Expects a “processed” subfolder with “run_1” folders in it which contain the data files (e.g., “point_cloud.pt”).
split (str) – Which split to use.
root – root of the preprocessed dataset on disk. Expects a “preprocessed” subfolder with “param0”, “param1”, …, “param8” folders in it which contain the data files (e.g., “surface_points.pt”).
split – Which split to use. Can be “train” or “test”.
position_scale (int | None) – _description_. Defaults to None.
grid_resolution (int | None) – For GINO, a pre-defined grid is needed; grid_resolution specifies the resolution of the grid. Defaults to None.
num_repeats (int) – Number of times to repeat the same dataset within a single epoch. This is mainly used during validation, to loop of the same datapoints to reduce variances. Defaults to 1.
- Raises:
NotImplementedError – When an unknown split is provided.
AssertionError – If the root path does not exist or is not a preprocessed folder.
AssertionError – If the number of uris does not match the expected number for the split
- split¶
- position_scale = None¶
- grid_resolution = None¶
- source_root¶
- num_repeats = 1¶
- grid_positions = None¶
- static get_normalization_stats()¶
Returns the normalization stats for the dataset. This is used in the collator to normalize the data.
- Return type:
- getitem_surface_position(idx)¶
Retrieves surface position (num_surface_points, 3)
- Parameters:
idx (int)
- Return type:
torch.Tensor
- getitem_surface_pressure(idx)¶
Retrieves surface pressure (num_surface_points, 1)
- Parameters:
idx (int)
- Return type:
torch.Tensor
- getitem_surface_normals(idx)¶
Retrieves surface normals (num_surface_points, 3)
- Parameters:
idx (int)
- Return type:
torch.Tensor
- getitem_volume_velocity(idx)¶
Retrieves volume velocity (num_volume_points, 3)
- Parameters:
idx (int)
- Return type:
torch.Tensor
- getitem_volume_position(idx)¶
Retrieves volume points (num_volume_points, 3)
- Parameters:
idx (int)
- Return type:
torch.Tensor