Ai
1 Star 0 Fork 1

wwzying/Pytorch-UNet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
data_vis.py 508 Bytes
一键复制 编辑 原始数据 按行查看 历史
milesial 提交于 2019-10-25 03:37 +08:00 . Global cleanup, better logging and CLI
import matplotlib.pyplot as plt
def plot_img_and_mask(img, mask):
classes = mask.shape[2] if len(mask.shape) > 2 else 1
fig, ax = plt.subplots(1, classes + 1)
ax[0].set_title('Input image')
ax[0].imshow(img)
if classes > 1:
for i in range(classes):
ax[i+1].set_title(f'Output mask (class {i+1})')
ax[i+1].imshow(mask[:, :, i])
else:
ax[1].set_title(f'Output mask')
ax[1].imshow(mask)
plt.xticks([]), plt.yticks([])
plt.show()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wwzying/Pytorch-UNet.git
git@gitee.com:wwzying/Pytorch-UNet.git
wwzying
Pytorch-UNet
Pytorch-UNet
master

搜索帮助