Fix misc warnings (#1894)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2023-05-09 14:11:28 -07:00
1 parent 28532c583f
commit 82c0c5545b
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -16,8 +16,8 @@
from typing import Literal, Optional
import matplotlib
import torch
from matplotlib import cm
from torchtyping import TensorType
from nerfstudio.utils import colors
@@ -88,7 +88,7 @@ def apply_float_colormap(
if colormap == "default":
colormap = "turbo"
colormap = cm.get_cmap(colormap)
colormap = matplotlib.colormaps[colormap]
colormap = torch.tensor(colormap.colors).to(image.device) # type: ignore
image = torch.nan_to_num(image, 0)
image_long = (image * 255).long()