mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
refactor(simulator): extract habitat simulator and visualization modules
This commit is contained in:
@@ -13,12 +13,17 @@ class ObjectNode:
|
||||
position: np.ndarray # [x, y, z] 世界坐标系下的中心点或锚点
|
||||
|
||||
# 特征:直接存你压缩后的 512bit 结果,不搞历史缓存
|
||||
visual_hash: np.ndarray # 512bit 视觉特征 (用于外观检索)
|
||||
semantic_hash: np.ndarray # 512bit 语义特征 (用于类别对齐)
|
||||
|
||||
# 原始图片:mask处理并裁切后的图片数据(二进制格式)
|
||||
image_bytes: bytes | None = None # numpy array.tobytes() 原始像素数据
|
||||
visual_hash: bytes # 512bit 视觉特征 (用于外观检索)
|
||||
semantic_hash: bytes # 512bit 语义特征 (用于类别对齐)
|
||||
|
||||
# Debug 必备:极简的生命周期管理,防止满屏"幽灵节点"
|
||||
hit_count: int = 1 # 被观测到的次数。太低的可以直接过滤掉
|
||||
last_seen_frame: int = 0 # 最后一次看到的帧号或时间戳
|
||||
|
||||
def __post_init__(self):
|
||||
if len(self.visual_hash) != 64:
|
||||
raise ValueError("visual_hash must be exactly 64 bytes (512 bits)")
|
||||
if len(self.semantic_hash) != 64:
|
||||
raise ValueError("semantic_hash must be exactly 64 bytes (512 bits)")
|
||||
if self.position.shape != (3,):
|
||||
raise ValueError("position must have shape (3,)")
|
||||
|
||||
Reference in New Issue
Block a user