Files
Mini-Nav/mini-nav/scenegraph/__init__.py
SikongJueluo a127032e18 feat(scenegraph): add SceneGraphBuilder for pipeline-driven graph construction
Introduce SceneGraphBuilder + SceneGraphBuildConfig to decouple scene graph
construction from the verification notebook. The builder handles batch
inference, hash encoding, and object node creation internally.

- Add SceneGraphBuilder.build_from_room_views() as the main entry point
- Add SceneGraphBuildConfig for inference_batch_size and position strategy
- Add SceneGraphBuildArtifacts to carry cropped images and debug metadata
- Extend ObjectNode with optional detection metadata (label, confidence,
  bbox_xyxy, source_view_id, position_confidence)
- Add RoomView frozen dataclass as a structured view container
- Add flatten_room_views() utility to replace inline list comprehensions
- Refactor notebooks/verification.py to use the new builder API

BREAKING CHANGE: ObjectNode now accepts additional optional fields; direct
scene_graph.objects[obj_id] = ObjectNode(...) construction in the notebook
is replaced by builder.build_from_room_views(...).
2026-05-30 16:57:38 +08:00

46 lines
1.2 KiB
Python

"""Scenegraph public API.
This module exports the main scenegraph objects for easy import:
from scenegraph import SimpleSceneGraph, RoomNode, ObjectNode
"""
from .builder import SceneGraphBuildArtifacts, SceneGraphBuildConfig, SceneGraphBuilder
from .hash_codec import (
bits_tensor_to_cam_row,
bits_tensor_to_hash_bytes,
cam_row_to_hash_bytes,
hash_bytes_to_bits_array,
hash_bytes_to_cam_row,
)
from .objectnode import ObjectNode
from .query import (
ImageHashPipeline,
ImageSceneGraphQueryResult,
query_image_against_scene_graph,
)
from .roomnode import RoomNode
from .scenegraph import SceneGraphMatch, SimpleSceneGraph
from .software_cam import CamMatch, SoftwareCamIndex, xnor_popcount_score
__all__ = [
"CamMatch",
"ImageHashPipeline",
"ImageSceneGraphQueryResult",
"ObjectNode",
"RoomNode",
"SceneGraphBuildArtifacts",
"SceneGraphBuildConfig",
"SceneGraphBuilder",
"SceneGraphMatch",
"SimpleSceneGraph",
"SoftwareCamIndex",
"bits_tensor_to_cam_row",
"bits_tensor_to_hash_bytes",
"cam_row_to_hash_bytes",
"hash_bytes_to_bits_array",
"hash_bytes_to_cam_row",
"query_image_against_scene_graph",
"xnor_popcount_score",
]