Pytorch 保存模型生成图片方式
作者:wzy_zju 时间:2023-04-20 17:42:17
三通道数组转成彩色图片
img=np.array(img1)
img=img.reshape(3,img1.shape[2],img1.shape[3])
img=(img+0.5)*255##img做过归一化处理,【-0.5,0.5】
img_path='/home/isee/wei/image/imageset/result.jpg'
img=cv2.merge(img)
cv2.imwrite(img_path,img)
单通道数组转化成灰度图
Img_mask=np.array(img_mask)*255 ##img_mask为二值图
Img_mask=cv2.merge(img_mask)
cv2.imwrite(img_path,img_mask)
来源:https://blog.csdn.net/wzy_zju/article/details/80778551
标签:Pytorch,保存模型,生成图片
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
微信小程序实现图片上传功能实例(前端+PHP后端)
2023-11-05 14:19:27
![](https://img.aspxhome.com/file/2023/8/56278_0s.jpg)
简写一个的lightbox显示隐藏层效果(兼容)
2010-07-23 20:02:00
网页效果图设计之色彩索引
2008-03-23 13:53:00
![](https://img.aspxhome.com/file/UploadPic/up/2008032314313926.gif)
通过php修改xml文档内容的方法
2024-06-07 15:45:30
PHP crypt()函数的用法讲解
2023-06-13 03:08:05
![](https://img.aspxhome.com/file/2023/9/55389_0s.png)
对python .txt文件读取及数据处理方法总结
2022-08-04 02:36:07
![](https://img.aspxhome.com/file/2023/5/65975_0s.jpg)
Python 远程开关机的方法
2022-06-19 18:12:30
![](https://img.aspxhome.com/file/2023/6/124416_0s.jpg)
Python实现邮件发送功能的示例详解
2022-08-18 13:15:43
![](https://img.aspxhome.com/file/2023/7/123807_0s.png)
JS事件在IE与FF中的区别详细解析
2023-09-24 23:02:35
用Python写王者荣耀刷金币脚本
2022-03-04 11:55:28
python的几种开发工具介绍
2021-09-28 01:54:44
Python实现制作透明背景的电子印章
2022-01-20 08:11:24
![](https://img.aspxhome.com/file/2023/1/134961_0s.jpg)
asp如何获知Connection对象更多的信息?
2009-11-23 20:53:00
JavaScrip如果基于url实现图片下载
2023-08-24 22:31:41
Python中json.dumps()函数的使用解析
2022-11-04 19:41:09
python-yml文件读写与xml文件读写
2022-06-16 06:43:50
![](https://img.aspxhome.com/file/2023/9/67919_0s.png)
pydantic resolve解决嵌套数据结构生成痛点分析
2022-06-05 02:16:36
Python真题案例之二分法查找详解
2023-09-23 01:39:07
![](https://img.aspxhome.com/file/2023/6/85376_0s.png)
Golang 实现复制文件夹同时复制文件
2024-02-09 10:57:26
基于python的selenium两种文件上传操作实现详解
2022-01-31 23:02:17
![](https://img.aspxhome.com/file/2023/6/97666_0s.png)