Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Notes
  • Loading branch information
shaoshitong committed Aug 17, 2022
commit 46242fd26b10cbf39a49031f4baee893ab5bb959
2 changes: 1 addition & 1 deletion projects/NeRF/configs/config_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_nerf_dataset(dataset_type="Blender"):
train.train_micro_batch_size = 1024
train.test_micro_batch_size = 1
train.dataset_type = "Blender"
train.blender_dataset_path = "/path/to/llff"
train.blender_dataset_path = "/home/Bigdata/Nerf/nerf_synthetic/chair"
train.llff_dataset_path = "/path/to/llff"
train.train_epoch = 16 if train.dataset_type == "Blender" else 30
train.warmup_ratio = 0 / train.train_epoch
Expand Down
4 changes: 4 additions & 0 deletions projects/NeRF/evaluation/nerf_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def process(self, inputs, outputs):
outputs["losses"],
outputs["rgbs"].squeeze(0),
)
"""
Notes:
这里也是一样,我需要通过额外的squeeze(0)操作来恢复原有的变量
"""
typ = list(outputs.keys())[1]
outputs.pop(typ)
outputs.pop("losses")
Expand Down
11 changes: 11 additions & 0 deletions projects/NeRF/modeling/System.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ def forward(self, rays, rgbs, c2w=None, valid_mask=None):
for key,value in results.items():
re[key] = value.unsqueeze(0)
re["rgbs"] = rgbs.unsqueeze(0)
"""
Notes:
这里首先不支持传出str,int等类型,且输出为一个字典,
后续代码会对这些指标进行计算,但通常情况下我想要传到
evaluator的不是相应指标,而是需要保存的中间值。因为
在这里我取不到forward的第一个batch_idx,所以只能
在evaluator进行运算。

可以的话在这里加入一个额外的字典,其中这个字典存储的元
素不会经过检查会直接传到evaluator,而供用户进行扩展。
"""
return re


Expand Down