记录
H_SQ__
这个作者很懒,什么都没留下…
展开
-
pip install 国内镜像源
pip install XXX -i https://pypi.tuna.tsinghua.edu.cn/simple常见国内镜像源:清华:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi.hustunique.com/山东理工大学:http://pyp原创 2022-05-13 21:33:17 · 2139 阅读 · 0 评论 -
灰度图像img.shape、(height, width)转为(height, width, channels)
from PIL import Imageimport numpy as npimport matplotlib.pyplot as pltimport cv2img = ‘./control23.tif’img = Image.open(img)img = np.array(img)print(img.shape)img=np.stack((img,)*3,axis=-1)print(img.shape)plt.imshow(img)原创 2022-05-13 21:06:57 · 1310 阅读 · 0 评论 -
报错:OSError:-2(已解决)
报错:OSError:-2构建自己的数据集读取文件时候出现问题;问题语句:pil_img = Image.open(img) #对路径进行读取,打开路径data = self.transforms(pil_img) #transforms进行转换替换为:pil_img=cv2.imread(img)pil_img=Image.fromarray(pil_img)data = self.transforms(pil_img)即可。...原创 2022-05-13 16:24:37 · 1368 阅读 · 1 评论