geometric_rgbd
geometric_rgbd
¶
Lightweight geometry-aware RGBD encoder.
GeometricRGBDEncoder
¶
GeometricRGBDEncoder(input_keys, embedding_dimension=512, number_of_heads=8, ffn_dimension=2048, decomposition_mode=value, initial_decay=2.0, decay_range=4.0, patch_size=16, pooling_method=value, pretrained=False, frozen=False, model_dtype=None)
Bases: RGBDEncoderMixin, Encoder
Single-layer geometry-aware RGBD encoder.
Initialize the geometric RGBD encoder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_keys
|
str | list[str]
|
Input keys for RGB and depth observations. |
required |
embedding_dimension
|
int
|
Dimension of patch embeddings and attention. |
512
|
number_of_heads
|
int
|
Number of attention heads. |
8
|
ffn_dimension
|
int
|
Hidden dimension of the feed-forward network. |
2048
|
decomposition_mode
|
str
|
Attention computation strategy (full or separable). |
value
|
initial_decay
|
float
|
Initial decay rate for spatial biases. |
2.0
|
decay_range
|
float
|
Range of decay rates across heads. |
4.0
|
patch_size
|
int
|
Size of image patches for the patch embedding. |
16
|
pooling_method
|
str
|
Feature pooling method applied after attention. |
value
|
pretrained
|
bool
|
Whether to use pretrained weights (not supported). |
False
|
frozen
|
bool
|
Whether to freeze encoder weights (not supported). |
False
|
model_dtype
|
str | None
|
Precision string from experiment config (e.g. |
None
|
Source code in src/versatil/models/encoding/encoders/cross_modal/rgbd/geometric_rgbd.py
encode_features
¶
Encode RGB and depth into joint RGBD features using geometric attention.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rgb_image
|
Tensor
|
RGB image tensor of shape (B*T, C, H, W); |
required |
depth_map
|
Tensor
|
Depth map tensor of shape (B*T, 1, H, W), temporally
flattened like |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
Tuple of (features, H_patches, W_patches) where features has shape |
int
|
(B*T, embedding_dimension, H_patches, W_patches). |
Source code in src/versatil/models/encoding/encoders/cross_modal/rgbd/geometric_rgbd.py
encode
¶
Encode RGB + depth into fused features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
dict[str, Tensor]
|
Dict with RGB as (B, C, H, W) and depth as (B, 1, H, W). |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
Dict with RGBD features. |
Source code in src/versatil/models/encoding/encoders/cross_modal/rgbd/geometric_rgbd.py
set_image_size
¶
Compute feature map dimensions and create pooling head.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_height
|
int
|
Target image height. |
required |
image_width
|
int
|
Target image width. |
required |
Source code in src/versatil/models/encoding/encoders/cross_modal/rgbd/geometric_rgbd.py
get_explainability_targets
¶
Return the geometric attention block for spatial attribution maps.
Returns:
| Type | Description |
|---|---|
list[VisionExplanationTarget]
|
One NHWC spatial feature-map target from the RGBD attention block. |
Source code in src/versatil/models/encoding/encoders/cross_modal/rgbd/geometric_rgbd.py
get_output_specification
¶
Return the output feature names and dimensions for this encoder.
Returns:
| Type | Description |
|---|---|
list[FeatureMetadata]
|
List of FeatureMetadata with RGBD feature name and its pooled dimension. |