自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 资源 (1)
  • 收藏
  • 关注

原创 python读取jpg图片resize并转为nv12格式保存

【代码】python读取jpg图片resize并转为nv12格式保存。

2023-08-18 14:14:31 665 1

原创 pytorch_一个batch的tensor转化为图片查看

# img = image_batch[0].mul(255).byte()# img = img.cpu().numpy().transpose((1, 2, 0))# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)# print("img",img)# cv2.imshow("12",img)# cv2.waitKey(0)# exit()

2022-04-16 15:51:16 2924

原创 python 同时以日期创建文件夹和txt文件

import osimport timedef mkdir_time_dir(): time_now = time.strftime("%Y-%m-%d-%H_%M", time.localtime()) path ="./vision/kvasir/{}".format(time_now) if not os.path.exists(path): os.makedirs(path) print("tensorboard dir mkdir s.

2022-04-15 21:26:53 412

原创 python以当前时间创建文件夹

import osimport timedef mkdir(path): folder = os.path.exists(path) if not folder: #判断是否存在文件夹如果不存在则创建为文件夹 os.makedirs(path) #makedirs 创建文件时如果路径不存在会创建这个路径 print ("--- new folder... ---") print ("--- OK ---") .

2022-04-14 18:51:39 2779 1

原创 批量修改文件夹图片名字

import osclass BatchRename(): def __init__(self): self.path = r'E:\datasets\EndoScene\ValidationDataset\aaa' def rename(self): filelist = os.listdir(self.path) print("filelist.sort():",filelist) filelist.sort().

2022-04-14 16:51:39 170

原创 医学图像分割模型预测保存图片不是二值图

问题:今天跑完模型代码分割出来的图片不是二值图,而是如下问题,蒙上了一层雾气一样,不是我想要的二值图错误代码:import cv2output=model(img)pred = torch.sigmoid(output)img = pred[0].mul(255).byte()img = img.cpu().numpy().transpose((1, 2, 0))img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)cv2.imwrite("./res.

2022-04-13 20:17:16 736 1

原创 LSTM在Transformer中应用输入输出维度设置

LSTM

2022-04-12 21:02:28 2466 1

原创 Pytorch报错TypeError : __init__() takes 1 positional argument but 2 were given 原因及解决方法

import torchfrom module.layer import simple_decoder,segmentation_head#错误写法,未实例化直接调用class model(nn.Module): def __init__(self): super(model, self).__init__() def forward(self,x): x=segmentation_head(x) return x# 正确写法,.

2022-03-30 13:35:01 6297

原创 创建Tensor验证模型

a=torch.randn(1, 64, 56, 56)

2022-03-29 21:16:46 149

可以打开keil4工程,支持中文

带pojie教程,可以打开keil4工程

2021-05-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除