code stringlengths 17 6.64M |
|---|
@register('slow_tv_lmdb')
class SlowTvLmdbDataset(SlowTvDataset):
'SlowTV dataset using LMDBs. See `SlowTvDataset` for additional details.'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.image_dbs = {}
self.calib_db = stv.load_calibs()
self.preload... |
@register('syns_patches')
class SynsPatchesDataset(MdeBaseDataset):
'SYNS-Patches dataset.\n\n Datum:\n - Image: Target image from which to predict depth.\n - Depth: Target ground-truth depth.\n - Edge: Target ground-truth depth boundaries.\n - K: Camera intrinsic parameters.\n\n ... |
@register('tum')
class TumDataset(MdeBaseDataset):
VALID_DATUM = 'image depth'
SHAPE = (480, 640)
def __init__(self, mode: str, datum='image depth', **kwargs):
super().__init__(datum=datum, **kwargs)
self.mode = mode
(self.split_file, self.items_data) = self.parse_items()
def... |
def get_json_file() -> Path:
'Path to the official DDAD config file.'
return ((PATHS['ddad'] / 'ddad_train_val') / 'ddad.json')
|
def get_dataset(mode: str, datum: ty.S[str]) -> SynchronizedSceneDataset:
'Get the official DDAD dataset for the target split.\n\n :param mode: (str) Dataset split to load. {train, val}\n :param datum: (list[str]) DDAD data types to load. {camera_0[1-5], lidar}\n :return: (SynchronizedSceneDataset) DDAD ... |
@dataclass
class Item():
'Class to load items from DIODE dataset.'
mode: str
split: str
scene: str
scan: str
stem: str
@classmethod
def get_split_file(cls, mode: str, split: str) -> Path:
'Get path to split file based on mode {train, val} and scene type {indoors, outdoor}.'
... |
def get_split_file(mode: str) -> Path:
'Get the split filename for the specified `mode`.'
return ((PATHS['mannequin'] / 'splits') / f'{mode}_files.txt')
|
def get_info_file(mode: str, seq: str) -> Path:
'Get info filename with calibration and poses based on the mode and sequence.'
return (((PATHS['mannequin'] / mode) / seq) / f'calibration.txt')
|
def get_img_file(mode: str, seq: str, stem: ty.U[(str, int)]) -> Path:
'Get image filename based on the mode, sequence and item number.'
return (((PATHS['mannequin'] / mode) / seq) / f'{int(stem):05}.jpg')
|
def get_depth_file(mode: str, seq: str, stem: ty.U[(str, int)]) -> Path:
'Get image filename based on the mode, sequence and item number.'
return (((PATHS['mannequin'] / mode) / seq) / f'{int(stem):05}.npy')
|
def load_split(mode: str) -> tuple[(Path, ty.S[Item])]:
'Load items (as [seq, stem]) in the specified split.'
file = get_split_file(mode)
items = io.tmap(Item, io.readlines(file, split=True), star=True)
return (file, items)
|
def load_info(mode: str, seq: str) -> dict[(str, dict[(str, ty.A)])]:
'Load image shape, intrinsics and poses for each image in sequence based on the mode and sequence.'
file = get_info_file(mode, seq)
lines = io.readlines(file, split=True)
(n_imgs, offset) = map(int, lines.pop(0))
assert (len(lin... |
def create_split(max=1000, seed=42):
mode = 'test'
root = (PATHS['mannequin'] / mode)
seq = io.get_dirs(root)
files = [f for s in seq for f in io.get_files(s, key=(lambda f: (f.suffix == '.npy')))]
random.seed(seed)
random.shuffle(files)
files = sorted(files[:max])
with open(get_split_... |
def get_split_file(mode: str) -> Path:
'Get the split filename for the specified `mode`.'
return ((PATHS['mannequin_lmdb'] / 'splits') / f'{mode}_files.txt')
|
def get_info_file(mode: str, seq: str) -> Path:
'Get info filename with calibration and poses based on the mode and sequence.'
return (((PATHS['mannequin_lmdb'] / mode) / seq) / f'calibration.txt')
|
def get_imgs_path(mode: str) -> Path:
'Get image LMDB filename based on the mode and sequence.'
return ((PATHS['mannequin_lmdb'] / mode) / 'images')
|
def get_depths_path(mode: str) -> Path:
'Get image LMDB filename based on the mode and sequence.'
return ((PATHS['mannequin_lmdb'] / mode) / 'depths')
|
def get_shapes_path(mode: str) -> Path:
'Get image LMDB filename based on the mode and sequence.'
return ((PATHS['mannequin_lmdb'] / mode) / 'shapes')
|
def get_intrinsics_path(mode: str) -> Path:
'Get image LMDB filename based on the mode and sequence.'
return ((PATHS['mannequin_lmdb'] / mode) / 'intrinsics')
|
def get_poses_path(mode: str) -> Path:
'Get image LMDB filename based on the mode and sequence.'
return ((PATHS['mannequin_lmdb'] / mode) / 'poses')
|
def load_split(mode: str) -> tuple[(Path, ty.S[Item])]:
'Load items (as [seq, stem]) in the specified split.'
file = get_split_file(mode)
items = io.tmap(Item, io.readlines(file, split=True), star=True)
return (file, items)
|
def load_info(mode: str, seq: str) -> dict[(str, dict[(str, ty.A)])]:
'Load image shape, intrinsics and poses for each image in sequence based on the mode and sequence.'
file = get_info_file(mode, seq)
lines = io.readlines(file, split=True)
(n_imgs, offset) = map(int, lines.pop(0))
assert (len(lin... |
def load_imgs(mode: str) -> ImageDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_imgs_path(mode)
return ImageDatabase(path)
|
def load_depths(mode: str) -> LabelDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_depths_path(mode)
return LabelDatabase(path)
|
def load_shapes(mode: str) -> LabelDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_shapes_path(mode)
return LabelDatabase(path)
|
def load_intrinsics(mode: str) -> LabelDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_intrinsics_path(mode)
return LabelDatabase(path)
|
def load_poses(mode: str) -> LabelDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_poses_path(mode)
return LabelDatabase(path)
|
def create_split_file(mode: str='train') -> None:
'Helper to create the files for each dataset split. {train, val, test}'
split_file = ((PATHS['mapfree'] / 'splits') / f'{mode}_files.txt')
io.mkdirs(split_file.parent)
files = sorted((PATHS['mapfree'] / mode).glob('./*/seq?/*.jpg'))
items = [f'''{f... |
@dataclass
class Item():
'Class to load items from MapFreeReloc dataset.'
mode: str
scene: str
seq: str
stem: str
@classmethod
def get_split_file(cls, mode: str) -> Path:
'Get path to dataset split. {train, val, test}'
return ((PATHS['mapfree'] / 'splits') / f'{mode}_files... |
@dataclass
class Item():
'Class to load items from the NYU Depth V2 dataset.'
mode: str
stem: str
@classmethod
def get_split_file(cls, mode: str) -> Path:
'Get path to dataset split. {train, test}.'
return ((PATHS['nyud'] / 'splits') / f'{mode}_files.txt')
@classmethod
de... |
def create_splits() -> None:
'Create train split based on all left camera files.'
split_file = ((PATHS['sintel'] / 'splits') / 'train_files.txt')
io.mkdirs(split_file.parent)
files = sorted(((PATHS['sintel'] / 'train') / 'camdata_left').glob('**/*.cam'))
items = [f'''{f.parent.stem} {f.stem}
''' f... |
@dataclass
class Item():
'Class to load Sintel items. NOTE: We use the official TRAINING split as our TEST set.'
mode: str
seq: str
stem: str
@classmethod
def get_split_file(cls, mode: str) -> Path:
'Get path to dataset split. {train}'
return ((PATHS['sintel'] / 'splits') / f'... |
def get_split_file(mode: str, split: str) -> Path:
'Get the split filename for the specified `mode`.'
file = (((PATHS['slow_tv_lmdb'] / 'splits') / f'{split}') / f'{mode}_files.txt')
return file
|
def get_category_file() -> Path:
'Get filename containing list of video URLs.'
return ((PATHS['slow_tv_lmdb'] / 'splits') / f'categories.txt')
|
def get_seqs() -> tuple[str]:
'Get tuple of sequences names in dataset.'
dirs = io.get_dirs(PATHS['slow_tv_lmdb'], key=(lambda d: (d.stem not in {'splits', 'videos', 'colmap'})))
dirs = io.tmap((lambda d: d.stem), dirs)
return dirs
|
def get_imgs_path(seq: str) -> Path:
'Get image LMDB filename based on the sequence.'
return (PATHS['slow_tv_lmdb'] / seq)
|
def get_calibs_path() -> Path:
'Get calibration LMDB filename based on the sequence.'
return (PATHS['slow_tv_lmdb'] / 'calibs')
|
def load_categories(subcats: bool=True) -> list[str]:
'Load list of categories per SlowTV scenes.'
file = get_category_file()
lines = [line.lower() for line in io.readlines(file)]
if (not subcats):
lines = [line.split('-')[0] for line in lines]
return lines
|
def load_split(mode: str, split: str) -> tuple[(Path, ty.S[Item])]:
'Load the split filename and items as (seq, stem).'
file = get_split_file(mode, split)
items = io.tmap(Item, io.readlines(file, split=True), star=True)
return (file, items)
|
def load_imgs(seq: str) -> ImageDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_imgs_path(seq)
return ImageDatabase(path)
|
def load_calibs() -> LabelDatabase:
'Load the image LMDB based on the mode and sequence.'
path = get_calibs_path()
return LabelDatabase(path)
|
def get_split_file(mode: str) -> Path:
'Get scene information file based on the scene number.'
file = ((PATHS['syns_patches'] / 'splits') / f'{mode}_files.txt')
return file
|
def get_scenes() -> list[Path]:
'Get paths to each of the scenes.'
return sorted((path for path in PATHS['syns_patches'].iterdir() if (path.is_dir() and (path.stem != 'splits'))))
|
def get_scene_files(scene_dir: Path) -> dict[(str, ty.S[Path])]:
'Get paths to all subdir files for a given scene.'
files = {key: sorted((scene_dir / key).iterdir()) for key in SUBDIRS if (scene_dir / key).is_dir()}
return files
|
def get_info_file(scene: str) -> Path:
'Get scene information file based on the scene number.'
paths = (PATHS['syns_patches'] / scene).iterdir()
return next((f for f in paths if (f.suffix == '.txt')))
|
def get_image_file(scene: str, file: str) -> Path:
'Get image filename based on scene and item number.'
return (((PATHS['syns_patches'] / scene) / 'images') / file)
|
def get_depth_file(scene: str, file: str) -> Path:
'Get image filename based on scene and item number.'
return (((PATHS['syns_patches'] / scene) / 'depths') / file).with_suffix('.npy')
|
def get_edges_file(scene: str, subdir: str, file: str) -> Path:
'Get image filename based on scene and item number.'
assert ('edges' in subdir), f'Must provide an "edges" directory. ({subdir})'
assert (subdir in SUBDIRS), f"Non-existent edges directory. ({subdir} vs. {[s for s in SUBDIRS if ('edges' in s)... |
def load_info(scene: str) -> ty.S[str]:
'Load the scene information.'
file = get_info_file(scene)
info = io.readlines(file, encoding='latin-1')
return info
|
def load_category(scene: str) -> tuple[(str, str)]:
'Load the scene category and subcategory.'
info = load_info(scene)
category = info[1].replace('Scene Category: ', '')
try:
(cat, subcat) = category.split(': ')
except ValueError:
(cat, subcat) = category.split(' - ')
return (c... |
def load_split(mode) -> tuple[(Path, ty.S[Item])]:
'Load the list of scenes and filenames that are part of the test split.\n\n Test split file is given as "SEQ ITEM":\n ```\n 01 00.png\n 10 11.png\n ```\n '
file = get_split_file(mode)
lines = io.tmap(Item, io.readlines(file, split=True),... |
def load_intrinsics() -> ty.A:
'Computes the virtual camera intrinsics for the `Kitti` based SYNS Patches.\n We compute this based on the desired FOV, using basic trigonometry.\n\n :return: (ndarray) (4, 4) Camera intrinsic parameters.\n '
(Fy, Fx) = KITTI_FOV
(h, w) = KITTI_SHAPE
(cx, cy) = ... |
@dataclass
class Item():
'Class to load items from TUM-RGBD dataset.'
seq: str
rgb_stem: str
depth_stem: str
@classmethod
def get_split_file(cls, mode: str) -> Path:
'Get path to dataset split. {test}'
return ((PATHS['tum'] / 'splits') / f'{mode}_files.txt')
@classmethod
... |
def create_splits(th: float=0.02, max: int=2500, seed: int=42) -> None:
'Create a split of associated images & depth maps.\n\n :param th: (float) Maximum time difference between two images to be considered as associated.\n :param max: (int) Maximum number of images in split.\n :param seed: (int) Random s... |
def read_file_list(filename):
'Reads a trajectory from a text file. From: https://cvg.cit.tum.de/data/datasets/rgbd-dataset/tools\n\n File format:\n The file format is "stamp d1 d2 d3 ...", where stamp denotes the time stamp (to be matched)\n and "d1 d2 d3.." is arbitary data (e.g., a 3D position and 3D ... |
def associate(first_list, second_list, offset, max_difference):
'Associate image and depth pairs. From: https://cvg.cit.tum.de/data/datasets/rgbd-dataset/tools\n\n Associate two dictionaries of (stamp,data). As the time stamps never match exactly, we aim\n to find the closest match for every input tuple.\n\... |
class Database():
_database = None
_protocol = None
_length = None
def __init__(self, path: PathLike, readahead: bool=True, pre_open: bool=False):
'Base class for LMDB-backed _databases.\n\n :param path: (PathLike) Path to the database.\n :param readahead: (bool) If `True`, enab... |
class ImageDatabase(Database):
def _convert_value(self, value):
'Converts a byte image back into a PIL Image.\n\n :param value: A byte image.\n :return: A PIL Image image.\n '
return Image.open(io.BytesIO(value))
|
class MaskDatabase(ImageDatabase):
def _convert_value(self, value):
'Converts a byte image back into a PIL Image.\n\n :param value: A byte image.\n :return: A PIL image.\n '
return Image.open(io.BytesIO(value)).convert('1')
|
class LabelDatabase(Database):
pass
|
class ArrayDatabase(Database):
_dtype = None
_shape = None
@property
def dtype(self):
if (self._dtype is None):
protocol = self.protocol
self._dtype = self._get(item='dtype', convert_key=(lambda key: pickle.dumps(key, protocol=protocol)), convert_value=(lambda value: p... |
class TensorDatabase(ArrayDatabase):
def _convert_value(self, value):
return torch.from_numpy(super(TensorDatabase, self)._convert_value(value))
def _convert_values(self, values):
return torch.from_numpy(super(TensorDatabase, self)._convert_values(values))
|
def write_image_database(d: dict, database: Path):
database.parent.mkdir(parents=True, exist_ok=True)
if database.exists():
shutil.rmtree(database)
tmp_database = database
with lmdb.open(path=f'{tmp_database}', map_size=(2 ** 40), writemap=True) as env:
with env.begin(write=True) as tx... |
def write_label_database(d: dict, database: Path):
database.parent.mkdir(parents=True, exist_ok=True)
if database.exists():
shutil.rmtree(database)
tmp_dir = (Path('/tmp') / f'TEMP_{time()}')
tmp_dir.mkdir(parents=True)
tmp_database = (tmp_dir / f'{database.name}')
with lmdb.open(path=... |
def write_array_database(d: dict, database: Path):
database.parent.mkdir(parents=True, exist_ok=True)
if database.exists():
shutil.rmtree(database)
tmp_database = database
with lmdb.open(path=f'{tmp_database}', map_size=(2 ** 40)) as env:
with env.begin(write=True) as txn:
... |
class AgentSnapshot2DList(AgentSnapshotList):
'Container for 2D agent list.\n\n Parameters\n ----------\n ontology: BoundingBoxOntology\n Ontology for 2D bounding box tasks.\n \n TODO : Add support for BoundingBox2DAnnotationList.\n boxlist: list[BoundingBox2D]\n List of BoundingBo... |
class AgentSnapshot3DList(AgentSnapshotList):
'Container for 3D agent list.\n\n Parameters\n ----------\n ontology: BoundingBoxOntology\n Ontology for 3D bounding box tasks.\n\n boxlist: list[BoundingBox3D]\n List of BoundingBox3D objects. See `utils/structures/bounding_box_3d`\n ... |
class AgentSnapshotList(ABC):
'Base agent snapshot list type. All other agent snapshot lists should inherit from this type and implement\n abstractmethod.\n\n Parameters\n ----------\n ontology: Ontology, default:None\n Ontology object for the annotation key.\n\n '
def __init__(self, on... |
class Annotation(ABC):
'Base annotation type. All other annotations should inherit from this type and implement\n member functions.\n\n Parameters\n ----------\n ontology: Ontology, default: None\n Ontology object for the annotation key\n '
def __init__(self, ontology=None):
if ... |
class BoundingBox2DAnnotationList(Annotation):
'Container for 2D bounding box annotations.\n\n Parameters\n ----------\n ontology: BoundingBoxOntology\n Ontology for 2D bounding box tasks.\n\n boxlist: list[BoundingBox2D]\n List of BoundingBox2D objects. See `dgp/utils/structures/boundin... |
class BoundingBox3DAnnotationList(Annotation):
'Container for 3D bounding box annotations.\n\n Parameters\n ----------\n ontology: BoundingBoxOntology\n Ontology for 3D bounding box tasks.\n\n boxlist: list[BoundingBox3D]\n List of BoundingBox3D objects. See `utils/structures/bounding_bo... |
class DenseDepthAnnotation(Annotation):
'Container for per-pixel depth annotation.\n\n Parameters\n ----------\n depth: np.ndarray\n 2D numpy float array that stores per-pixel depth.\n '
def __init__(self, depth):
assert isinstance(depth, np.ndarray)
assert (depth.dtype in ... |
class KeyLine2DAnnotationList(Annotation):
'Container for 2D keyline annotations.\n\n Parameters\n ----------\n ontology: KeyLineOntology\n Ontology for 2D keyline tasks.\n\n linelist: list[KeyLine2D]\n List of KeyLine2D objects. See `dgp/utils/structures/key_line_2d` for more details.\n... |
class KeyLine3DAnnotationList(Annotation):
'Container for 3D keyline annotations.\n\n Parameters\n ----------\n ontology: KeyLineOntology\n Ontology for 3D keyline tasks.\n\n linelist: list[KeyLine3D]\n List of KeyLine3D objects. See `dgp/utils/structures/key_line_3d` for more details.\n... |
class KeyPoint2DAnnotationList(Annotation):
'Container for 2D keypoint annotations.\n\n Parameters\n ----------\n ontology: KeyPointOntology\n Ontology for 2D keypoint tasks.\n\n pointlist: list[KeyPoint2D]\n List of KeyPoint2D objects. See `dgp/utils/structures/key_point_2d` for more de... |
class KeyPoint3DAnnotationList(Annotation):
'Container for 3D keypoint annotations.\n\n Parameters\n ----------\n ontology: KeyPointOntology\n Ontology for 3D keypoint tasks.\n\n pointlist: list[KeyPoint3D]\n List of KeyPoint3D objects. See `dgp/utils/structures/key_point_3d` for more de... |
class Ontology():
'Ontology object. At bare minimum, we expect ontologies to provide:\n ID: (int) identifier for class\n Name: (str) string identifier for class\n Color: (tuple) color RGB tuple\n\n Based on the task, additional fields may be populated. Refer to `dataset.proto` and `ontolog... |
class BoundingBoxOntology(Ontology):
'Implements lookup tables specific to 2D bounding box tasks.\n\n Parameters\n ----------\n ontology_pb2: [OntologyV1Pb2,OntologyV2Pb2]\n Deserialized ontology object.\n '
def __init__(self, ontology_pb2):
super().__init__(ontology_pb2)
s... |
class AgentBehaviorOntology(BoundingBoxOntology):
'Agent behavior ontologies derive directly from bounding box ontologies'
|
class KeyPointOntology(BoundingBoxOntology):
'Keypoint ontologies derive directly from bounding box ontologies'
|
class KeyLineOntology(BoundingBoxOntology):
'Keyline ontologies derive directly from bounding box ontologies'
|
class InstanceSegmentationOntology(BoundingBoxOntology):
'Instance segmentation ontologies derive directly from bounding box ontologies'
|
class SemanticSegmentationOntology(Ontology):
'Implements lookup tables for semantic segmentation\n\n Parameters\n ----------\n ontology_pb2: [OntologyV1Pb2,OntologyV2Pb2]\n Deserialized ontology object.\n '
def __init__(self, ontology_pb2):
super().__init__(ontology_pb2)
s... |
def remap_bounding_box_annotations(bounding_box_annotations, lookup_table, original_ontology, remapped_ontology):
"\n Parameters\n ----------\n bounding_box_annotations: BoundingBox2DAnnotationList or BoundingBox3DAnnotationList\n Annotations to remap\n\n lookup_table: dict\n Lookup from... |
def remap_semantic_segmentation_2d_annotation(semantic_segmentation_annotation, lookup_table, original_ontology, remapped_ontology):
"\n Parameters\n ----------\n semantic_segmentation_annotation: SemanticSegmentation2DAnnotation\n Annotation to remap\n\n lookup_table: dict\n Lookup from... |
def remap_instance_segmentation_2d_annotation(instance_segmentation_annotation, lookup_table, original_ontology, remapped_ontology):
"\n Parameters\n ----------\n instance_segmentation_annotation: PanopticSegmentation2DAnnotation\n Annotation to remap\n\n lookup_table: dict\n Lookup from... |
def construct_remapped_ontology(ontology, lookup, annotation_key):
"Given an Ontology object and a lookup from old class names to new class names, construct\n an ontology proto for the new ontology that results\n\n Parameters\n ----------\n ontology: dgp.annotations.Ontology\n Ontology we are t... |
class Compose():
'Composes several transforms together.\n\n Parameters\n ----------\n transforms\n List of transforms to compose __call__ method that takes in an OrderedDict\n\n Example:\n >>> transforms.Compose([\n >>> transforms.CenterCrop(10),\n >>> ... |
class BaseTransform():
"\n Base transform class that other transforms should inherit from. Simply ensures that\n input type to `__call__` is an OrderedDict (in general usage this dict will include\n keys such as 'rgb', 'bounding_box_2d', etc. i.e. raw data and annotations)\n\n cf. `OntologyMapper` for... |
class OntologyMapper(BaseTransform):
'\n Mapping ontology based on a lookup_table.\n The remapped ontology will base on the remapped_ontology_table if provided.\n Otherwise, the remapped ontology will be automatically constructed based on the order of lookup_table.\n\n Parameters\n ----------\n ... |
class AddLidarCuboidPoints(BaseTransform):
'Populate the num_points field for bounding_box_3d'
def __init__(self, subsample: int=1) -> None:
'Populate the num_points field for bounding_box_3d. Optionally downsamples the point cloud for speed.\n\n Parameters\n ----------\n subsamp... |
class InstanceMaskVisibilityFilter(BaseTransform):
'Given a multi-modal camera data, select instances whose instance masks appear big enough *at least in one camera*.\n\n For example, even when an object is mostly truncated in one camera, if it looks big enough in a neighboring\n camera in the multi-modal s... |
class BoundingBox3DCoalescer(BaseTransform):
'Coalesce 3D bounding box annotation from multiple datums and use it as an annotation of target datum.\n The bounding boxes are brought into the target datum frame.\n\n Parameters\n ----------\n src_datum_names: list[str]\n List of datum names used t... |
@click.group()
@click.version_option()
def cli():
logging.getLogger().setLevel(level=logging.INFO)
|
@cli.command(name='visualize-scene')
@add_options(options=VISUALIZE_OPTIONS)
@click.option('--scene-json', required=True, help='Path to Scene JSON')
def visualize_scene(scene_json, annotations, camera_datum_names, dataset_class, show_instance_id, max_num_items, video_fps, dst_dir, verbose, lidar_datum_names, render_p... |
@cli.command(name='visualize-scenes')
@click.option('--scene-dataset-json', required=True, help='Path to SceneDataset JSON')
@click.option('--split', type=click.Choice(['train', 'val', 'test', 'train_overfit']), required=True, help='Dataset split to be fetched.')
@add_options(options=VISUALIZE_OPTIONS)
def visualize_... |
class AddLidarCuboidPointsContext(AddLidarCuboidPoints):
'Add Lidar Points but applied to samples not datums'
def __call__(self, sample: List[Dict[(str, Any)]]) -> List[Dict[(str, Any)]]:
new_sample = []
for datum in sample:
if ((datum['datum_type'] == 'point_cloud') and ('boundin... |
class ScaleImages(ScaleAffineTransform):
'Scale Transform but applied to samples not datums'
def __call__(self, sample: List[Dict[(str, Any)]]) -> List[Dict[(str, Any)]]:
new_sample = []
for datum in sample:
if ((datum['datum_type'] == 'image') and ('rgb' in datum)):
... |
@click.group()
@click.version_option()
def cli():
logging.getLogger('dgp2widker').setLevel(level=logging.INFO)
logging.getLogger('py4j').setLevel(level=logging.CRITICAL)
logging.getLogger('botocore').setLevel(logging.CRITICAL)
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger... |
@cli.command(name='ingest')
@click.option('--scene-dataset-json', required=True, help='Path to DGP Dataset JSON')
@click.option('--wicker-dataset-name', required=True, default=None, help='Name of dataset in Wicker')
@click.option('--wicker-dataset-version', required=True, help='Version of dataset in Wicker')
@click.o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.