首页 > 其他分享 >lightweight 保存图片

lightweight 保存图片

时间:2023-02-23 12:46:06浏览次数:36  
标签:human sum 保存 maps str lightweight image 图片

        if label['img_paths']=='000000011791.jpg':
#if label['img_paths']=='000000537548.jpg':
sum=0
print('imgpeth',label['img_paths'])
image=image.transpose((2, 0, 1))
print('shape',image.shape)
os.mkdir('/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum))
#plt.imsave('/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(sum)+'.png', image)
torchvision.utils.save_image(torch.tensor(image.astype(np.float32)),'/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(sum)+'.png')
print('keypoint_maps',keypoint_maps.shape)
print('paf_maps',paf_maps.shape)
for k in range(19):
torchvision.utils.save_image(torch.tensor(keypoint_maps[k,:,:].astype(np.float32)),'/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(k)+'h'+'.png')
#im = Image.fromarray(keypoint_maps[0,k,:,:])
#im.save('/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(k)+'h'+'.png')
for k in range(38):
torchvision.utils.save_image(torch.tensor(paf_maps[k,:,:].astype(np.float32)),'/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(k)+'off'+'.png')
#im = Image.fromarray(keypoint_maps[0,k,:,:])
#im.save('/home/ubuntu/lightw/lightweight-human-pose-estimation.pytorch-master/11/'+str(sum)+'/'+str(k)+'h'+'.png')
print('全部保存')

标签:human,sum,保存,maps,str,lightweight,image,图片
From: https://www.cnblogs.com/hahaah/p/17147530.html

相关文章

  • 正在保存“index.vue”: 正在运行 "vetur" 格式化程序
    一、问题描述这几天用VSCode突然不能保存格式化文件了。二、把插件 Vetur 降版,我用v0.36.1成功解决了这个问题。如果有其他解决方法,可以发在评论区,感谢!现在最新版本......
  • 现代图片性能优化及体验优化指南 - 缩放精细化展示及避免布局偏移、拉伸
    本文是系列第三篇。系列文章:现代图片性能优化及体验优化指南-图片类型及Picture标签的使用现代图片性能优化及体验优化指南-响应式图片方案图片资源,在我们的业......
  • JS批量下载图片
    已用该文章的知识实现了批量下载,所需的两个JS文件可以在GitHub下载<scriptsrc="/js/jszip.js"></script><scriptsrc="/js/FileSaver.min.js"></script><script>......
  • Android笔记-跳转到相册选择图片
    跳转到相册选择图片即设置一个点击事件,点击之后即可跳转到相册进行图片的选择具体的实现步骤:界面很简单的啦,这里就直接将源代码放出来啦:<?xmlversion="1.0"encoding=......
  • 模型保存
    目录保存整个模型(保存了模型框架、权重、优化器配置)保存:model.save('less_model.h5')加载:tf.keras.models.load_model('less_model.h5')仅保存架构保存:model.to_json(......
  • 创建多线程方式3:实现Callable接口 改造下载图片案例
    packagecom.Test;importorg.apache.commons.io.FileUtils;importjava.io.File;importjava.io.IOException;importjava.net.URL;importjava.util.concurrent.*;//开......
  • tensor类型保存图片
    os.mkdir('/home/ubuntu/DEKR-main1/11/'+str(i))torchvision.utils.save_image(image,'/home/ubuntu/DEKR-main1/11/'+str(i)+'/'+str(i)+'.png')......
  • tensorflow.js 视频图片多目标检测
    前言:    Tensorflow.js官方提供了很多常用模型库,涵盖了平时开发中大部分场景的模型。例如,前面提到的图片识别,除此之外还有人体姿态识别,目标物体识别,语音文字等识......
  • C++ 17 遍历文件夹图片文件进行循环操作
    #include<filesystem>usingnamespacestd;namespacefs=std::filesystem; stringpath=filepath;//替换为指定目录的路径 for(constauto&entry:fs::dir......
  • 【Bootstrap】008-全局样式:图片
    一、响应式图片1、说明在Bootstrap版本3中,通过为图片添加.img-responsive类可以让图片支持响应式布局。其实质是为图片设置了max-width:100%;、height:auto;和d......