NeRF源码解读
imgs : 根据 .json 文件加载到的所有图像数据。(N,H,W,4)N 代表用于 train、test、val 的总数量(4:RGBβ) poses : 转置矩阵。(N,4,4) render_poses : 用于测试的 pose 。(40,4,4) i_split : [[0:train], [train:val], [val:test]]
γ(p)=(sin(20πp),cos(20πp),⋯,sin(2L−1πp),cos(2L−1πp))
参数
images: (138, 400, 400, 4), 图像总数, 高宽分别为400, 400, 4通道(RGBA)
poses: (138, 4, 4), 138个图像对应的相机位姿(4*4的c2w变换矩阵)
render_poses: (40, 4, 4), 40个用于测试的位姿(4*4的c2w变换矩阵)
hwf: (3,), 图像的高宽和焦距
i_split: train[0:100], val[0:13], tea-st[0:25]图像的索引
include_input: 编码结果是否包括原始坐标
input_dims: 输入数据的维度
max_freq_log2: 位置编码函数最大频率 L-1
num_freqs: 位置编码函数的频率数 L
log_sampling: 频率是否使用指数增长
periodic_fns: 编码函数[sin, cos]
embed_fns: 存储编码函数
out_dim: 存储编码后的总维度
embed_fn: 位置编码器
input_ch: 编码后的总维度(作为MLP输入时的维度)
use_viewdirs: 使用完整的5D坐标
embeddirs_fn: 存储方向坐标编码函数
input_ch_views: 编码后的总维度(方向坐标)
netdepth: 网络深度 8层
netwidth: 网络宽度 256 粗糙网络(coarse network)上取 64 点, 精细网络(fine network)上取 64 + 128 = 192个点, 一共256个点
input_ch: 位置坐标输入维度x 63
output_ch: 输出维度 5 (RGB + density)
skips: 跳跃连接层 第五层 输入向量维度为319
input_ch_views: 视角方向输入维度d 27
use_viewdirs: 是否使用视角方向
pst_linears: 存储MLP的8个隐藏层(包含一个跨越层,319个特征输入)
views_linears: 存储一个额外的线性层(用于输入方向坐标信息,输出密度density,输入256+27, 输出128)
netdepth_fine: 精细网络深度 8
netwidth_fine: 精细网络特征 256
netchunk: 网络批量处理的数量 102464 rays points
N_rand: 批量大小(每个梯度的随机射线数量)
N_samples: 每条射线的粗糙网络采样点数
N_importance: 每条射线额外的精细网络采样点数