当前位置: 首页 > news >正文

sparse4d记录

instance bank介绍

num_anchor:总anchor个数,包括历史的
num_cur:当前帧预测的query个数
num_temp:历史保存的query个数

num_anchor = num_cur + num_temp

get:
forward时在所有decoder layer推理前调用。
if 有历史信息:
历史结果egopose变换到当前帧,并更新self.cached_anchor . 类似prepare的作用, cached_anchor应该历史保存的num_temp个
else if 没有历史信息:
reset
update:
第一层refine后调用,将当前帧预测的query取top num_cur 个和历史num_temp个拼接。返回拼接后的 num_anchor 个query,不更新self.cached_anchor

cache:
所有decoder layer结束后调用,取topk个query保存下来,更新 self.cached_anchor

def forward:
query = instancebanck.get()
for i in range(num_decoder_layer):
query = decoder_layer(query) # 从当前帧预测出num_anchor个query
if i == 0:
query = instancebank.update(query)
isinstancebank.cache(query) # 保存num_temp个query到instancebank中

[2:] 截断后(去掉首个 gnn, norm):
[deformable, ffn, norm, refine,
temp_gnn, gnn, norm, deformable, ffn, norm, refine, (×5)]


完整调用流程图:

forward() 开始

├─ instance_bank.get()
│ 返回:
│ instance_feature [B, num_anchor, C] ← 可学习参数,不含历史
│ anchor [B, num_anchor, D]
│ temp_instance_feature = cached_feature ← 上帧缓存,可能为 None
│ temp_anchor = cached_anchor
│ time_interval

├─ 拼接 dn_anchor → anchor / instance_feature 变为 [B, num_anchor+num_dn, *]

│ ════════ 单帧 Decoder(第0轮,只有后半段) ════════

├─ [op: deformable] 图像特征采样,更新 instance_feature
├─ [op: ffn] 前馈网络
├─ [op: norm] Layer Norm
├─ [op: refine] 预测 anchor/cls/quality
│ prediction=[anchor_0], classification=[cls_0]
│ len(prediction)==1 == num_single_frame_decoder ← 触发!
│ │
│ └─ instance_bank.update(instance_feature, anchor, cls)
│ ┌─ 若 cached_feature 为 None(第一帧)→ 直接返回,不变
│ └─ 否则:
│ topk 选出当前帧 top-(num_anchor-num_temp) 个实例
│ 拼接 [cached_feature(历史) | selected_feature(当前)]
│ instance_feature 更新为 [历史|当前] 混合,shape 仍 [B, num_anchor, C]

│ ════════ 时序 Decoder ×5 ════════

│ ┌─ [op: temp_gnn] ← 跨帧 cross-attention
│ │ query = instance_feature(已含历史)
│ │ key/value = temp_instance_feature(纯历史 cached_feature)
│ │ → 融合时序信息,更新 instance_feature
│ │
│ ├─ [op: gnn] 帧内 self-attention
│ ├─ [op: norm]
│ ├─ [op: deformable] 图像特征采样
│ ├─ [op: ffn]
│ ├─ [op: norm]
│ └─ [op: refine] 预测 anchor/cls/quality,追加到 prediction/classification
│ (×5 重复)

├─ instance_bank.cache(instance_feature, anchor, cls)
│ topk 选 num_temp_instances 个高置信度实例
│ 存入 cached_feature / cached_anchor ← 供下一帧 temp_gnn 使用

└─ [仅推理] instance_bank.get_instance_id(cls, anchor)
分配/继承跨帧 instance ID,用于追踪


关键设计点总结:

┌───────────────────┬────────────────────────────────────────────────────────┐
│ 阶段 │ instance_feature 内容 │
├───────────────────┼────────────────────────────────────────────────────────┤
│ get() 之后 │ 纯可学习参数,无历史 │
├───────────────────┼────────────────────────────────────────────────────────┤
│ 单帧 decoder 期间 │ 当前帧图像特征驱动 │
├───────────────────┼────────────────────────────────────────────────────────┤
│ update() 之后 │ [:num_temp_instances] = 历史,[num_temp:] = 当前 top-N │
├───────────────────┼────────────────────────────────────────────────────────┤

http://www.jsqmd.com/news/621930/

相关文章:

  • HTML怎么限制输入字符数_HTML input maxlength属性用法【详解】
  • 来自椭圆曲线算术非平凡性的 CMB 低阶谱对数周期调制(世毫九实验室原创理论)
  • C 语言文件操作 / C++ 文件操作 / Linux 系统调用文件操作 全部带完整代码、注释、运行说明。
  • STM32F103C8T6驱动DHT11温湿度传感器,从CubeMX配置到OLED显示(附完整工程)
  • C#怎么使用泛型 C#泛型类泛型方法和泛型约束的定义和使用方法【语法】
  • 基于REX-UniNLU的智能客服系统开发实战
  • 54-CubeMX-STM32F103RC-TMIER2-输出PWM
  • AI原生软件交付提速300%?揭秘美团新一代研发流水线如何重构MLOps与DevOps融合范式
  • Mirage Flow模拟计算机网络环境:辅助教学与协议调试
  • 2026年企业新媒体代运营从“内容发布“到“增长合伙人“的价值跃迁
  • 从零开始:手把手教你用Python脚本创建第一个USD场景(附完整代码)
  • 华为eNSP模拟器综合实验之- WLAN瘦AP配置实战案例详解
  • Qwen3-ASR-1.7B场景应用:会议记录自动化,提升工作效率
  • 为什么92%的AI测试POC项目在2025年Q4失败?——2026奇点大会核心议题深度拆解,含可复用的LLM测试契约模板
  • Mac外接硬盘格式哪种更稳?选NTFS还是ExFAT?
  • Canvas动画实战:用requestAnimationFrame打造会飘动的彩虹云朵
  • 从零到一:基于Rook Operator的Ceph集群云原生部署与Kubernetes存储集成全攻略
  • 千问3.5-9B卷积神经网络(CNN)原理详解与模型调优实战
  • AcousticSense AI使用技巧:如何让音乐流派识别更准确
  • 美胸-年美-造相Z-Turbo多场景应用:游戏公司NPC立绘批量生成与风格统一性保障
  • Claude 从零起步:新手快速上手指南(2026年4月版)
  • 用FastAPI和OpenCV给你的个人照片做个‘魔法变身’:7种特效的Web应用保姆级搭建
  • Qwen-Image-2512-SDNQ MATLAB集成教程:科研图表自动生成
  • Fish Speech 1.5部署教程:CSDN平台GPU实例网络策略与安全组配置
  • 5分钟搞定鱼眼相机畸变校正:OpenCV实战教程(附Python代码)
  • AI万能分类器部署实战:开箱即用,构建智能工单分类系统
  • Qwen2.5-VL-7B-Instruct功能全解析:从图片描述到物体定位,一篇文章讲清楚
  • 零代码玩转HY-Motion 1.0:在Gradio可视化界面中实时预览文字转动作
  • 别再只画静态图了!用Qt QChart实现可交互波形图的5个高级技巧
  • AI Agent 可以操作哪些表单和数据收集工具?MCP 支持情况盘点