
记录
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 · 2379 阅读 · 0 评论 -
灰度图像img.shape、(height, width)转为(height, width, channels)
from PIL import Image import numpy as np import matplotlib.pyplot as plt import cv2 img = ‘./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 · 1487 阅读 · 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 · 2208 阅读 · 1 评论