Skip to content

Depth

dataphy.visionpack.tforms.depth

Classes

DepthNoise(sigma_mm_at_1m: List[float] = [1.0, 5.0], quad_scale: bool = True, missing_prob: List[float] = [0.0, 0.05], hole_fill: Literal['none', 'interp'] = 'none', profile: Literal['tof', 'stereo', 'structured_light', 'generic'] = 'generic', holes_prob: List[float] = None, edge_dropout_prob: List[float] = None, speckle: List[float] = None, guidance: Literal['none', 'rgb_edges'] = 'none', **kwargs: Any)

Bases: BaseTransform

Source code in src/dataphy/visionpack/tforms/depth.py
def __init__(
    self,
    sigma_mm_at_1m: List[float] = [1.0, 5.0],
    quad_scale: bool = True,
    missing_prob: List[float] = [0.0, 0.05],
    hole_fill: Literal["none", "interp"] = "none",
    # profile extensions
    profile: Literal["tof", "stereo", "structured_light", "generic"] = "generic",
    holes_prob: List[float] = None,
    edge_dropout_prob: List[float] = None,
    speckle: List[float] = None,
    guidance: Literal["none", "rgb_edges"] = "none",
    **kwargs: Any
):
    super().__init__(**kwargs)
    self.sigma_mm_at_1m_range = sigma_mm_at_1m
    self.quad_scale = quad_scale
    self.missing_prob_range = missing_prob
    self.hole_fill = hole_fill
    self.profile = profile
    self.holes_prob = holes_prob or [0.0, 0.0]
    self.edge_dropout_prob = edge_dropout_prob or [0.0, 0.0]
    self.speckle = speckle or [0.0, 0.0]
    self.guidance = guidance
Attributes
sigma_mm_at_1m_range = sigma_mm_at_1m instance-attribute
quad_scale = quad_scale instance-attribute
missing_prob_range = missing_prob instance-attribute
hole_fill = hole_fill instance-attribute
profile = profile instance-attribute
holes_prob = holes_prob or [0.0, 0.0] instance-attribute
edge_dropout_prob = edge_dropout_prob or [0.0, 0.0] instance-attribute
speckle = speckle or [0.0, 0.0] instance-attribute
guidance = guidance instance-attribute
p = p instance-attribute
apply_to = apply_to if apply_to is not None else ['rgb'] instance-attribute
sync_views = sync_views instance-attribute
update_intrinsics = update_intrinsics instance-attribute
mask_protect = mask_protect if mask_protect is not None else [] instance-attribute
min_visible_mask_pct = min_visible_mask_pct instance-attribute
resample = resample instance-attribute
border_mode = border_mode instance-attribute
pad_mode = pad_mode instance-attribute
pad_value = pad_value instance-attribute
seed_policy = seed_policy instance-attribute
Functions
forward(batch: Dict[str, Any]) -> Dict[str, Any]

Base forward method that handles cross-cutting logic.

Source code in src/dataphy/visionpack/tforms/base.py
def forward(self, batch: Dict[str, Any]) -> Dict[str, Any]:
    """Base forward method that handles cross-cutting logic."""
    if not self._should_apply():
        return batch

    # Setup seed policy
    episode_id = batch.get("episode_id")
    self._setup_seed(episode_id)

    # Apply transform
    return self._apply_transform(batch)

DepthQuantize(bits: List[int] = [10, 12, 16], **kwargs: Any)

Bases: BaseTransform

Source code in src/dataphy/visionpack/tforms/depth.py
def __init__(
    self,
    bits: List[int] = [10, 12, 16],
    **kwargs: Any
):
    super().__init__(**kwargs)
    self.bits_options = bits
Attributes
bits_options = bits instance-attribute
p = p instance-attribute
apply_to = apply_to if apply_to is not None else ['rgb'] instance-attribute
sync_views = sync_views instance-attribute
update_intrinsics = update_intrinsics instance-attribute
mask_protect = mask_protect if mask_protect is not None else [] instance-attribute
min_visible_mask_pct = min_visible_mask_pct instance-attribute
resample = resample instance-attribute
border_mode = border_mode instance-attribute
pad_mode = pad_mode instance-attribute
pad_value = pad_value instance-attribute
seed_policy = seed_policy instance-attribute
Functions
forward(batch: Dict[str, Any]) -> Dict[str, Any]

Base forward method that handles cross-cutting logic.

Source code in src/dataphy/visionpack/tforms/base.py
def forward(self, batch: Dict[str, Any]) -> Dict[str, Any]:
    """Base forward method that handles cross-cutting logic."""
    if not self._should_apply():
        return batch

    # Setup seed policy
    episode_id = batch.get("episode_id")
    self._setup_seed(episode_id)

    # Apply transform
    return self._apply_transform(batch)