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

ShapeNetCarStats

Normalization statistics for the ShapeNet Car dataset.

ShapeNetCarDataset

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.

raw_pos_min: tuple[float]
raw_pos_max: tuple[float] = (6.0,)
raw_pos_surface_min: tuple[float]
raw_pos_surface_max: tuple[float] = (3,)
volume_pos_mean: tuple[float, float, float]
volume_pos_std: tuple[float, float, float] = (1.03378, 0.682603, 2.27282)
surface_pos_mean: tuple[float, float, float] = (9.00692e-05, 0.60236, 0.0252252)
surface_pos_std: tuple[float, float, float] = (0.649866, 0.378063, 1.35368)
surface_pressure_mean: tuple[float]
surface_pressure_std: tuple[float] = (48.6757,)
volume_velocity_mean: tuple[float, float, float]
volume_velocity_std: tuple[float, float, float] = (1.361689, 1.267649, 5.850353)
volume_sdf_mean: tuple[float] = (0.374222,)
volume_sdf_std: tuple[float] = (0.178948,)
class emmi_inference.datasets.shapenet.ShapeNetCarDataset(root, split, position_scale=None, grid_resolution=None, num_repeats=1, **kwargs)

Bases: ksuit.data.Dataset

Dataset 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:
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:

ShapeNetCarStats

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

getitem_volume_sdf(idx)

Retrieves volume sdf w.r.t. the car body (num_volume_points, 1)

Parameters:

idx (int)

Return type:

torch.Tensor

getitem_volume_normals(idx)

Retrieves volume normals (num_volume_points, 3)

Parameters:

idx (int)

Return type:

torch.Tensor