Available Nodes¶
This page lists all the implemented nodes in the regenbogen framework. Each node is a self-contained processing unit that can be combined in pipelines.
For detailed API documentation, see the API Reference page.
Implemented Nodes¶
Data Loading & I/O¶
- BOPDatasetNode
Loads and streams data from BOP (Benchmark for 6D Object Pose Estimation) format datasets with automatic downloading.
Input: None (source node)
Output:
(Frame, List[Pose], List[int])- Frame with ground truth poses and object IDsImplementation: regenbogen/nodes/bop_dataset.py
- VideoReaderNode
Reads and streams frames from video files (MP4, AVI, etc.) using OpenCV.
Input: None (source node)
Output:
Frame- Stream of video framesImplementation: regenbogen/nodes/video_reader.py
Depth Estimation¶
- DepthAnythingNode
Monocular depth estimation using Depth Anything V1 model from HuggingFace.
Input:
Framewith RGB imageOutput:
Framewith depth map addedImplementation: regenbogen/nodes/depth_anything.py
- DepthAnything3Node
Monocular depth estimation with visual odometry using Depth Anything V3 (fork with optional pycolmap).
Input:
Framewith RGB image (or stream of frames)Output:
FrameorList[Frame]with depth and camera posesImplementation: regenbogen/nodes/depth_anything3.py
Segmentation¶
- SAM2Node
Automatic instance segmentation using Segment Anything Model 2 (SAM2) from Meta.
Input:
Framewith RGB image (or tuple from dataset loader)Output:
Maskswith segmentation masks, bounding boxes, and confidence scoresImplementation: regenbogen/nodes/sam2.py
Feature Extraction¶
- Dinov2Node
Dense feature extraction using DINOv2 vision transformer with patch-level and global descriptors.
Input:
Framewith RGB imageOutput:
Featureswith dense or global feature descriptorsImplementation: regenbogen/nodes/dinov2.py
- TemplateDescriptorNode
Extracts and manages descriptors from template images for CNOS-style matching.
Input:
Framewith templatesOutput:
Featureswith template descriptorsImplementation: regenbogen/nodes/template_descriptor.py
Point Cloud Processing¶
- DepthToPointCloudNode
Converts depth images and camera intrinsics to 3D point clouds.
Input:
Framewith depth and intrinsics (or stream/list of frames)Output:
Framewith point cloud and colors addedImplementation: regenbogen/nodes/depth_to_pointcloud.py
- PartialPointCloudExtractionNode
Extracts point cloud regions corresponding to detected objects using bounding boxes.
Input:
(Frame, BoundingBoxes)- Frame with point cloud and object detectionsOutput:
List[Frame]with partial point clouds per objectImplementation: regenbogen/nodes/partial_pointcloud_extraction.py
- MeshSamplingNode
Samples points from 3D mesh models to create reference point clouds.
Input:
ObjectModelwith mesh dataOutput:
ObjectModelwith sampled point cloud addedImplementation: regenbogen/nodes/mesh_sampling.py
Pose Estimation & Refinement¶
- CNOSMatcherNode
CNOS-style template matching for 6D pose estimation using feature descriptors.
Input:
(Frame, Features)- Query frame and template featuresOutput:
BoundingBoxeswith detected objects and initial posesImplementation: regenbogen/nodes/cnos_matcher.py
- ICPRefinementNode
Refines pose estimates using ICP (Iterative Closest Point) alignment.
Input:
(ObjectModel, PointCloud, Pose)- Model, scene, and initial poseOutput:
Pose- Refined pose estimateImplementation: regenbogen/nodes/icp_refinement.py
- SphericalPoseGeneratorNode
Generates camera poses evenly distributed on a sphere around an object.
Input: None (generator node)
Output:
Iterator[Pose]- Camera poses on sphereImplementation: regenbogen/nodes/spherical_pose_generator.py
Rendering¶
- TemplateRendererNode
Renders RGB-D templates from 3D mesh models using pyrender for offline rendering.
Input:
(ObjectModel, Iterator[Pose])- Mesh and camera posesOutput:
Iterator[Frame]- Rendered RGB-D framesImplementation: regenbogen/nodes/template_renderer.py
Evaluation¶
- RMSEEvaluationNode
Evaluates pose estimation accuracy using RMSE metrics.
Input:
(List[Pose], List[Pose])- Predicted and ground truth posesOutput:
ErrorMetricswith RMSE statisticsImplementation: regenbogen/nodes/rmse_evaluation.py
Usage Examples¶
BOP Dataset Loading¶
from regenbogen.nodes import BOPDatasetNode
# Create BOP dataset loader for YCB-Video with automatic download
bop_loader = BOPDatasetNode(
dataset_name="ycbv", # Dataset name
split="test",
scene_id=0, # Load only scene 0
max_samples=10, # Load only first 10 samples
load_depth=True,
load_models=True,
allow_download=True, # Automatically download if not found
name="YCB_Loader"
)
# Stream samples
for frame, gt_poses, obj_ids in bop_loader.stream_dataset():
print(f"Frame: {frame.rgb.shape}")
print(f"Objects: {obj_ids}")
for pose in gt_poses:
print(f" Rotation:\n{pose.rotation}")
print(f" Translation: {pose.translation}")
# Get a specific sample
result = bop_loader.get_sample(scene_id=0, image_id=5)
if result is not None:
frame, gt_poses, obj_ids = result
print(f"Loaded sample: scene={frame.metadata['scene_id']}, image={frame.metadata['image_id']}")
# Load 3D object models
models = bop_loader.get_object_models()
for obj_id, model in models.items():
print(f"Model {obj_id}: {model.name}")
print(f" Vertices: {model.mesh_vertices.shape}")
Basic Node Usage¶
from regenbogen.nodes import DepthAnythingNode
from regenbogen.interfaces import Frame
# Create node
depth_node = DepthAnythingNode(model_type="vits")
# Process frame
result = depth_node.process(input_frame)
Pipeline Integration¶
from regenbogen import Pipeline
from regenbogen.nodes import DepthAnythingNode, DepthToPointCloudNode
# Create pipeline
pipeline = Pipeline(name="Depth_Pipeline")
pipeline.add_node(DepthAnythingNode())
pipeline.add_node(DepthToPointCloudNode())
# Process data
result = pipeline.process(input_frame)
Template Rendering¶
from regenbogen.nodes import (
BOPDatasetNode,
SphericalPoseGeneratorNode,
TemplateRendererNode,
)
# Load object model from BOP dataset
bop_loader = BOPDatasetNode(
dataset_name="ycbv",
load_models=True,
allow_download=True
)
object_model = bop_loader.get_object_model(object_id=1)
# Generate camera poses on a sphere
pose_generator = SphericalPoseGeneratorNode(
radius=0.5, # 0.5 meters from object
elevation_levels=3,
azimuth_samples=8,
inplane_rotations=1
)
poses = pose_generator.generate_poses()
# Render RGB-D templates
renderer = TemplateRendererNode(
width=640,
height=480,
fx=640,
fy=640
)
templates = renderer.render_templates(object_model, poses)
# Process templates
for i, frame in enumerate(templates):
print(f"Template {i}:")
print(f" RGB shape: {frame.rgb.shape}")
print(f" Depth shape: {frame.depth.shape}")
# Save or use templates for pose estimation
For complete examples, see the examples/ directory in the repository.