Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下有人做了可视化的复现吗,C++的头文件在哪里啊 #67

Open
qixy13 opened this issue Mar 18, 2020 · 1 comment

Comments

@qixy13
Copy link

qixy13 commented Mar 18, 2020

No description provided.

@LiNinghui-AI
Copy link

给预测的Mask上色,看下面代码
import cv2
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import LinearSegmentedColormap

#在自建的colorabar ,得到自己想要的颜色
def get_spectral():

ALL = 0
VEGETATION = 1
ROAD = 4
BUILDING = 2
WATER = 3
colormap_float = np.zeros( (5, 3), np.float ) #新建一个数组用于存储颜色的数值

colormap_float[ALL, :] = [255, 255, 255]
colormap_float[WATER, :] = [34, 180, 238]
colormap_float[VEGETATION, :] = [159, 255, 84]
colormap_float[BUILDING, :] = [255, 191, 0]
# colormap_float[BUILDING, :] = [34, 180, 238]
colormap_float[ROAD, :] = [38, 71, 139]

return colormap_float

matplotlib.use("Qt5Agg")
path = Satellite-Segmentation-master/segnet/pre1.png"
p_mask = cv2.imread(path)

w, h, d = np.shape(p_mask)
p_src = np.full((w, h, d), 0, dtype=np.uint8)

colormap_float = get_spectral()
rgb_table = LinearSegmentedColormap.from_list('sst cmap', colormap_float/255)

import cmaps
plt.imshow((p_mask[..., 0]), cmap=rgb_table)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants