scene_service.scene_graph.relations¶
Edge candidate generation and LLM-based relation inference.
Functions
|
|
|
Return candidate pairs with precomputed geometry hints. |
Classes
|
Infer the spatial relation between two objects via LLM. |
- class scene_service.scene_graph.relations.RelationInferer(llm_client: SceneGraphLLMClient)[source]¶
Bases:
objectInfer the spatial relation between two objects via LLM.
- async infer_relation(source: SceneGraphNode, target: SceneGraphNode, hint: GeometryHint) SceneGraphEdge[source]¶
Call LLM to infer the relation from source to target.
Returns a SceneGraphEdge. On LLM failure the edge has
relation="unknown"andmethod="llm_fail".
- scene_service.scene_graph.relations.compute_geometry_hint(a: SceneGraphNode, b: SceneGraphNode) GeometryHint[source]¶
- scene_service.scene_graph.relations.generate_edge_candidates(nodes: list[SceneGraphNode], *, max_distance: float = 2.0, min_xy_overlap: float = 0.15, max_candidates: int = 200) list[tuple[SceneGraphNode, SceneGraphNode, GeometryHint]][source]¶
Return candidate pairs with precomputed geometry hints.
- A pair is a candidate if any of these hold:
center distance < max_distance
XY overlap ratio > min_xy_overlap
one bbox contains the other