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

相关推荐
GoGeekBaird27 分钟前
GoHumanLoopHub开源上线,开启Agent人际协作新方式
人工智能·后端·github
Jinkxs36 分钟前
测试工程师的AI转型指南:从工具使用到测试策略重构
人工智能·重构
别惹CC1 小时前
Spring AI 进阶之路01:三步将 AI 整合进 Spring Boot
人工智能·spring boot·spring
stbomei3 小时前
当 AI 开始 “理解” 情感:情感计算技术正在改写人机交互规则
人工智能·人机交互
Moshow郑锴8 小时前
人工智能中的(特征选择)数据过滤方法和包裹方法
人工智能
TY-20258 小时前
【CV 目标检测】Fast RCNN模型①——与R-CNN区别
人工智能·目标检测·目标跟踪·cnn
CareyWYR9 小时前
苹果芯片Mac使用Docker部署MinerU api服务
人工智能
失散139 小时前
自然语言处理——02 文本预处理(下)
人工智能·自然语言处理
mit6.82410 小时前
[1Prompt1Story] 滑动窗口机制 | 图像生成管线 | VAE变分自编码器 | UNet去噪神经网络
人工智能·python
sinat_2869451910 小时前
AI应用安全 - Prompt注入攻击
人工智能·安全·prompt