- 博客(5)
- 资源 (2)
- 收藏
- 关注
转载 python中的opencv和PIL(pillow)转化
opencv > pilimport cv2 from PIL import Imageimg = cv2.imread("test.png")image = Image.fromarray(cv2.cvtColor(img,cv2.COLOR_BGR2RGB)) pil > opencvimport cv2 from PIL import Image imag...
2018-09-26 08:46:37 4430
原创 python读取以及保存gif图
1.使用模块 imageioimageio.mimread: 读取gif,每一帧会存放到list的一个位置中imageio.mimsave: 保存gif,输入也是一个list数组注意::不要用matplotlib.pylot.imread,这样读出来的数据会有问题...
2018-09-21 13:56:31 10029 3
转载 pytorch: Variable, tensor,numpy相互类型转换
转自:https://blog.csdn.net/pengge0433/article/details/794596791.将numpy矩阵转换为Tensor张量sub_ts = torch.from_numpy(sub_img) #sub_img为numpy类型2.将Tensor张量转化为numpy矩阵sub_np1 = sub_ts.numpy() ...
2018-09-15 16:57:44 808
原创 pyTorch 错误提示
TypeError: argument 0 is not a Variable原因:在于输入data不是Variable,需转化成Variable格式。解决:from torch.autograd import Variabledata = Variable(data)
2018-09-15 16:30:26 333
原创 python-函数中变量名的搜过过程
函数中的变量名如何去解释,解释为局部变量?全局?还是什么。。。The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store ...
2018-09-01 08:22:24 206
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人