mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 05:48:57 +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:
1 parent
403ab26f0c
commit
382ed853f2
2 files changed
+3
-4
No files matched your search
@@ -71,9 +71,6 @@ const initialState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function setData(newState, state, path, data) {
|
function setData(newState, state, path, data) {
|
||||||
if (path === 'colormap_options') {
|
|
||||||
newState.colormap_choice = 'default'; // eslint-disable-line no-param-reassign
|
|
||||||
}
|
|
||||||
if (path.length === 1) {
|
if (path.length === 1) {
|
||||||
newState[path[0]] = data; // eslint-disable-line no-param-reassign
|
newState[path[0]] = data; // eslint-disable-line no-param-reassign
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -753,10 +753,12 @@ class ViewerState:
|
|||||||
if self.output_type_changed or self.prev_colormap_type is None:
|
if self.output_type_changed or self.prev_colormap_type is None:
|
||||||
self.prev_colormap_type = ColormapTypes.DEFAULT
|
self.prev_colormap_type = ColormapTypes.DEFAULT
|
||||||
colormap_options = []
|
colormap_options = []
|
||||||
|
self.vis["renderingState/colormap_options"].write(list(ColormapTypes))
|
||||||
if outputs[reformatted_output].shape[-1] == 3:
|
if outputs[reformatted_output].shape[-1] == 3:
|
||||||
colormap_options = [ColormapTypes.DEFAULT]
|
colormap_options = [ColormapTypes.DEFAULT]
|
||||||
if outputs[reformatted_output].shape[-1] == 1 and outputs[reformatted_output].dtype == torch.float:
|
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.output_type_changed = False
|
||||||
self.vis["renderingState/colormap_choice"].write(self.prev_colormap_type)
|
self.vis["renderingState/colormap_choice"].write(self.prev_colormap_type)
|
||||||
self.vis["renderingState/colormap_options"].write(colormap_options)
|
self.vis["renderingState/colormap_options"].write(colormap_options)
|
||||||
|
|||||||
Reference in new issue
Block a user