DGPDataset

class packnet_sfm.datasets.dgp_dataset.DGPDataset(path, split, cameras=None, depth_type=None, with_pose=False, with_semantic=False, back_context=0, forward_context=0, data_transform=None)[source]

Bases: object

DGP dataset class

Parameters
  • path (str) – Path to the dataset

  • split (str {'train', 'val', 'test'}) – Which dataset split to use

  • cameras (list of str) – Which cameras to get information from

  • depth_type (str) – Which lidar will be used to generate ground-truth information

  • with_pose (bool) – If enabled pose estimates are also returned

  • with_semantic (bool) – If enabled semantic estimates are also returned

  • back_context (int) – Size of the backward context

  • forward_context (int) – Size of the forward context

  • data_transform (Function) – Transformations applied to the sample

generate_depth_map(sample_idx, datum_idx, filename)[source]

Generates the depth map for a camera by projecting LiDAR information. It also caches the depth map following DGP folder structure, so it’s not recalculated

Parameters
  • sample_idx (int) – sample index

  • datum_idx (int) – Datum index

  • filename – Filename used for loading / saving

Returns

depth – Depth map for that datum in that sample

Return type

np.array [H, W]

get_backward(key, sensor_idx)[source]

Return backward timesteps of a key from a sensor

get_context(key, sensor_idx)[source]

Get both backward and forward contexts

get_current(key, sensor_idx)[source]

Return current timestep of a key from a sensor

get_filename(sample_idx, datum_idx)[source]

Returns the filename for an index, following DGP structure

Parameters
  • sample_idx (int) – Sample index

  • datum_idx (int) – Datum index

Returns

filename – Filename for the datum in that sample

Return type

str

get_forward(key, sensor_idx)[source]

Return forward timestep of a key from a sensor

packnet_sfm.datasets.dgp_dataset.stack_sample(sample)[source]

Stack a sample from multiple sensors