Update show.
This commit is contained in:
parent
8583bc56d7
commit
ce64a2f7aa
|
@ -6,6 +6,7 @@ import cv2
|
|||
import math
|
||||
import numpy as np
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def DumpTensorToImage(tensor, name, forceSquare=False, scale=1.0, Contrast=None, GridValue=None):
|
||||
|
@ -68,6 +69,9 @@ def DumpTensorToImage(tensor, name, forceSquare=False, scale=1.0, Contrast=None,
|
|||
img[img > 255] = 255
|
||||
imgs = img.astype(np.uint8)
|
||||
imgs = cv2.applyColorMap(imgs, cv2.COLORMAP_JET)
|
||||
directory = Path(name).parent
|
||||
if not directory.is_dir():
|
||||
directory.mkdir(parents=True, exist_ok=True)
|
||||
cv2.imwrite(name, imgs)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue