4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

Replace default colormap option with turbo for single-channel output (#1568)

replace default colormap option with turbo for single-channel output

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
This commit is contained in:
Dreek Fire 2023-03-09 13:24:04 -08:00 committed by GitHub
parent 403ab26f0c
commit 382ed853f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -71,9 +71,6 @@ const initialState = {
};
function setData(newState, state, path, data) {
if (path === 'colormap_options') {
newState.colormap_choice = 'default'; // eslint-disable-line no-param-reassign
}
if (path.length === 1) {
newState[path[0]] = data; // eslint-disable-line no-param-reassign
} else {

View File

@ -753,10 +753,12 @@ class ViewerState:
if self.output_type_changed or self.prev_colormap_type is None:
self.prev_colormap_type = ColormapTypes.DEFAULT
colormap_options = []
self.vis["renderingState/colormap_options"].write(list(ColormapTypes))
if outputs[reformatted_output].shape[-1] == 3:
colormap_options = [ColormapTypes.DEFAULT]
if outputs[reformatted_output].shape[-1] == 1 and outputs[reformatted_output].dtype == torch.float:
colormap_options = list(ColormapTypes)
self.prev_colormap_type = ColormapTypes.TURBO
colormap_options = list(ColormapTypes)[1:]
self.output_type_changed = False
self.vis["renderingState/colormap_choice"].write(self.prev_colormap_type)
self.vis["renderingState/colormap_options"].write(colormap_options)