airfrans.sampling

cell_sampling_2d(seed, cell_points, cell_attr=None)[source]

Sample points in a two dimensional cell via parallelogram sampling and triangle interpolation via barycentric coordinates. The vertices have to be ordered in a certain way.

Parameters
  • seed (int) – Seed for the random number generator.

  • cell_points (np.ndarray) – Vertices of the 2 dimensional cells. Shape (N, 4) for N cells with 4 vertices.

  • cell_attr (np.ndarray, optional) – Features of the vertices of the 2 dimensional cells. Shape (N, 4, k) for N cells with 4 edges and k features. If given shape (N, 4) it will resize it automatically in a (N, 4, 1) tensor. Default: None

cell_sampling_1d(seed, line_points, line_attr=None)[source]

Sample points in a one dimensional cell via linear sampling and interpolation.

Parameters
  • seed (int) – Seed for the random number generator.

  • line_points (np.ndarray) – Edges of the 1 dimensional cells. Shape (N, 2) for N cells with 2 edges.

  • line_attr (np.ndarray, optional) – Features of the edges of the 1 dimensional cells. Shape (N, 2, k) for N cells with 2 edges and k features. If given shape (N, 2) it will resize it automatically in a (N, 2, 1) tensor. Default: None