From 2ba2cbef0ddc98a9b34aa8186023c9946612c284 Mon Sep 17 00:00:00 2001 From: Aditya_Bajracharya <84086387+Aditya-Bajra@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:30:15 +0545 Subject: [PATCH] Fix AttributeError in ColormapRegistry Fix AttributeError in ColormapRegistry: add get_cmap method --- run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index 14810ff..715134e 100644 --- a/run.py +++ b/run.py @@ -1,7 +1,7 @@ import argparse import cv2 import glob -import matplotlib +import matplotlib.pyplot as plt import numpy as np import os import torch @@ -47,7 +47,7 @@ os.makedirs(args.outdir, exist_ok=True) - cmap = matplotlib.colormaps.get_cmap('Spectral_r') + cmap = plt.get_cmap('Spectral_r') for k, filename in enumerate(filenames): print(f'Progress {k+1}/{len(filenames)}: {filename}') @@ -70,4 +70,4 @@ split_region = np.ones((raw_image.shape[0], 50, 3), dtype=np.uint8) * 255 combined_result = cv2.hconcat([raw_image, split_region, depth]) - cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), combined_result) \ No newline at end of file + cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), combined_result)