IBR-net 代码研读

1. TrainDataloader

从TrainDataset 里面读取 RGB 根据 图像生成 Ray

2. Feature Map 生成

假设原图的 shape (512,512,3), 选择原图相近的 10张图像,经过U-Net 类似的结构之后,生成的 特征Tensor 是(10,64,128,128)。 这个特征图 分成2个(10,32,128,128) 和 (10,32,128,128) 分别送入到 Coarse IBR-net 和 Fine IBR-Net 中去

3. 最重要的依据 Feature Map 去得到 color 和 density

3.1 根据 射线得到采样点,然后往关联的feature map 上面做投影,查询feature.

5000条射线采样64个点,shape (500,64,3), 然后这些世界系的采样点往 关联的 RGB 图像上进行投影,并查询相关的RGB 数值。

python 复制代码
## 世界系的3D点做投影
 pixel_locations, mask_in_front = self.compute_projections(xyz, train_cameras)
 normalized_pixel_locations = self.normalize(pixel_locations, h, w)   # [n_views, n_rays, n_samples, 2]

 # rgb sampling, 根据投影的坐标查询RGB
 rgbs_sampled = F.grid_sample(train_imgs, normalized_pixel_locations, align_corners=True)
 rgb_sampled = rgbs_sampled.permute(2, 3, 0, 1)  # [n_rays, n_samples, n_views, 3]

## 根据 投影的在feature map 的坐标查询 对应的 Feature 
feat_sampled = F.grid_sample(featmaps, normalized_pixel_locations, align_corners=True)
feat_sampled = feat_sampled.permute(2, 3, 0, 1)  # [n_rays, n_samples, n_views, d]

## 将查询得到的 RGB 和 feature Concat 起来
rgb_feat_sampled = torch.cat([rgb_sampled, feat_sampled], dim=-1)   # [n_rays, n_samples, n_views, d+3]

投影点会落在 图像边界外,因此有一个 Mask 来 记录提取的feature 的有效性。

3.2 计算空间采样点的 density 和 color

1. 将采样点对10张关联的 direction 进行MLP学习成35维度的feature

通过一个MLP,将每个世界点到 相关方向的 direction (500,64,10.3) 通过MLP 学成 (500,64,10,35) 维度的feature

相关推荐
冬奇Lab1 小时前
一天一个开源项目(第256篇):Anatomy —— 让 Claude 为技术概念「发明一台机器」,画成可交互的等距插画
人工智能·开源
孟郎郎1 小时前
打造一切(Craft Anything)——克隆构造世间万物
人工智能·ai·github·软件构建·开源软件
Martina_03211 小时前
AI生成3D场景的霓虹灯一开就糊成光团?用6步检查Emissive、Bloom与曝光
人工智能·3d·ai·自然语言处理·游戏引擎·材质·贴图
master3362 小时前
AI领域常用名词的系统梳理
人工智能·ai
Spidermanbaout2 小时前
Prompt-Engineering实战-2026年11月2日
人工智能·机器学习·ai·chatgpt·ai编程
阿里云大数据AI技术3 小时前
EMR Serverless StarRocks + DLF Paimon 多模态数据湖检索
人工智能
文青的青3 小时前
不写一行代码,用 WorkBuddy 搭建并上线个人静态博客
人工智能
IT_陈寒3 小时前
Redis连接池泄漏那次,我差点把生产环境搞崩了
前端·人工智能·后端
Dawson Zhu3 小时前
从空间 Scaling 到时间 Scaling
人工智能·语言模型·架构·aigc·agi