python image
zhicheng_gogogo
这个作者很懒,什么都没留下…
展开
-
json.decoder.JSONDecodeError: Unterminated string starting at: line 159642 column 14 (char 5324622)
conda install 问题(py36_for_pytorch020) abc@robot:~/Desktop/CSPN-master/cspn_pytorch$ conda install samtoolsSolving environment: failed# >>>>>>>>>>>>>>>&...原创 2019-12-25 16:57:12 · 7844 阅读 · 10 评论 -
深度学习图像处理中tf.reduce_mean(), tf.reduce_sum(), tf.boolean_mask()
import tensorflow as tfimport numpy as nptensor = [[1, 2], [3, 4], [5, 6]]mask=np.array([[True,True],[False,True],[False,False]])z=tf.boolean_mask(tensor, mask)with tf.Session() as sess: ...原创 2019-11-20 11:04:38 · 329 阅读 · 0 评论 -
OSError: cannot write mode F as BMP
python 保存图片是会遇到如下问题:Traceback (most recent call last): File "C:\Users\zhichengpc\AppData\Local\Programs\Python\Python36\lib\site-packages\PIL\BmpImagePlugin.py", line 231, in _save rawmode, bi...原创 2019-03-14 11:12:38 · 5924 阅读 · 0 评论 -
SURF匹配python实现
# -*- coding: utf-8 -*-"""Created on Thu Jun 20 16:25:27 2019推荐使用OPENCV 3.1.0及以下版本两幅png为middlebury上面的示例图片@author: zhangzhicheng"""import numpy as npimport cv2from matplotlib import pyplot a...原创 2019-06-27 14:43:48 · 7463 阅读 · 2 评论 -
Keras 使用自己的数据集进行训练和测试
from PIL import Imageimport matplotlib.pyplot as pltimport os, sysfrom keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_arrayimport numpy as npimport kerasfrom keras.m...原创 2019-07-03 08:51:30 · 7998 阅读 · 1 评论 -
Python返回数组不为0位置,并组合起来
import numpy as npC = np.arange(15).reshape(3, 5)choice = np.where(C!=0)print(choice)#(array([0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2], dtype=int64), array([1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3...原创 2019-07-03 10:53:01 · 4304 阅读 · 0 评论 -
OverflowError: integer division result too large for a float
n,m = map(int,input().split())l=m+n-1a=1b=1for i in range(l,m,-1): a*=ifor j in range(1,n): b*=jprint(a)print(b)res = int(a/b)print(res%1000000007)Traceback (most recent call last)...原创 2019-09-10 09:28:33 · 9666 阅读 · 0 评论 -
python 将np.array中满足条件的数组下标存放到list当中存储
a=np.array([[0,1],[0,1]])print(a)b=np.where(a!=0)print(b)c=list(map(list, zip(*b)))print(c)输出如下:[[0 1][0 1]](array([0, 1], dtype=int64), array([1, 1], dtype=int64))[[0, 1], [1, 1]]...原创 2019-09-24 14:29:18 · 1659 阅读 · 0 评论