mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 22:38:48 +08:00
Add colormaps to logs
This commit is contained in:
1 parent
c164fd5207
commit
cf9c557b7b
6 files changed
+39
-6
No files matched your search
@@ -20,6 +20,7 @@ from mattport.nerf.renderers import AccumulationRenderer, DisparityRenderer, RGB
|
||||
from mattport.nerf.sampler import PDFSampler, UniformSampler
|
||||
from mattport.structures import colors
|
||||
from mattport.structures.rays import RaySamples
|
||||
from mattport.utils import visualization
|
||||
|
||||
|
||||
class NeRFField(nn.Module):
|
||||
@@ -162,12 +163,16 @@ class NeRFGraph(Graph):
|
||||
fine_renderer_accumulation = self.renderer_accumulation(fine_weights) # RendererOutputs
|
||||
fine_renderer_disparity = self.renderer_disparity(fine_weights, pdf_ray_samples.ts)
|
||||
|
||||
# TODO refactor this into "vis" section. Doesn't need to be run during training.
|
||||
coarse_renderer_accumulation = visualization.apply_colormap(coarse_renderer_accumulation.accumulation)
|
||||
fine_renderer_accumulation = visualization.apply_colormap(fine_renderer_accumulation.accumulation)
|
||||
|
||||
# outputs:
|
||||
outputs = {
|
||||
"rgb_coarse": coarse_renderer_outputs.rgb,
|
||||
"rgb_fine": fine_renderer_outputs.rgb,
|
||||
"accumulation_coarse": coarse_renderer_accumulation.accumulation,
|
||||
"accumulation_fine": fine_renderer_accumulation.accumulation,
|
||||
"accumulation_coarse": coarse_renderer_accumulation,
|
||||
"accumulation_fine": fine_renderer_accumulation,
|
||||
"disparity_coarse": coarse_renderer_disparity.disparity,
|
||||
"disparity_fine": fine_renderer_disparity.disparity,
|
||||
}
|
||||
|
||||
@@ -260,8 +260,8 @@ class Trainer:
|
||||
disparity_fine.append(graph_outputs["disparity_fine"])
|
||||
rgb_coarse = torch.cat(rgb_coarse).view(image_height, image_width, 3).detach().cpu()
|
||||
rgb_fine = torch.cat(rgb_fine).view(image_height, image_width, 3).detach().cpu()
|
||||
accumulation_coarse = torch.cat(accumulation_coarse).view(image_height, image_width, 1).detach().cpu()
|
||||
accumulation_fine = torch.cat(accumulation_fine).view(image_height, image_width, 1).detach().cpu()
|
||||
accumulation_coarse = torch.cat(accumulation_coarse).view(image_height, image_width, 3).detach().cpu()
|
||||
accumulation_fine = torch.cat(accumulation_fine).view(image_height, image_width, 3).detach().cpu()
|
||||
disparity_coarse = torch.cat(disparity_coarse).view(image_height, image_width, 1).detach().cpu()
|
||||
disparity_fine = torch.cat(disparity_fine).view(image_height, image_width, 1).detach().cpu()
|
||||
|
||||
|
||||
Reference in new issue
Block a user