上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 # 生成x数据 4 x = np.linspace(-10,10,100) 5 y = np.tanh(x) 6 plt.plot(x,y) 7 plt.show() 阅读全文
posted @ 2020-05-22 11:38 小他_W 阅读(1239) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 import matplotlib.pyplot as plt 3 def sigmoid(x): 4 return 1.0/(1+np.exp(-x)) 5 x = np.arange(-10,10,step = 1)# 生成一个numpy数组 6 f 阅读全文
posted @ 2020-05-22 11:21 小他_W 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1 from win32com.client import Dispatch 2 speaker = Dispatch('SAPI.SpVoice') 3 speaker.Speak('大家好,我是小怪兽') 4 del speaker 阅读全文
posted @ 2020-05-21 18:00 小他_W 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 1 import pyttsx3 as pyttsx 2 engine = pyttsx.init() 3 engine.say('小怪兽') 4 engine.runAndWait() 阅读全文
posted @ 2020-05-21 17:55 小他_W 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 1 import cv2 2 import numpy as np 3 import os 4 # 加载训练数据集文件 5 recognizer = cv2.face.LBPHFaceRecognizer_create() 6 recognizer.read('D:/trainer/trainer. 阅读全文
posted @ 2020-05-21 15:07 小他_W 阅读(1785) 评论(1) 推荐(0) 编辑
摘要: 1 import os #遍历路径 2 import cv2 3 import sys 4 import numpy as np 5 from PIL import Image 6 def getImageAndLabels(path): 7 facesSamples = [] 8 ids = [] 阅读全文
posted @ 2020-05-21 14:22 小他_W 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1 import cv2 as cv 2 def face_detect_demo(img): 3 #将图片灰度 4 gray=cv.cvtColor(img,cv.COLOR_BGR2GRAY) 5 #加载特征数据 6 face_detector = cv.CascadeClassifier( 7 阅读全文
posted @ 2020-05-21 10:42 小他_W 阅读(595) 评论(0) 推荐(0) 编辑
摘要: 1 import cv2 as cv 2 def face_detect_demo(): 3 # 将图片转化为灰度图片 4 gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) 5 # 加载特征数据 6 face_detector = cv.CascadeClassif 阅读全文
posted @ 2020-05-20 22:52 小他_W 阅读(610) 评论(0) 推荐(0) 编辑
摘要: 1 import cv2 as cv 2 def face_detect_demo(): 3 # 将图片转化为灰度图片 4 gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) 5 # 加载特征数据 6 face_detector = cv.CascadeClassif 阅读全文
posted @ 2020-05-20 21:59 小他_W 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 import cv2 as cv 2 img = cv.imread('C:/Users/87823/Desktop/Aaron_Ecke.jpg') 3 print(img.shape) 4 # 左上角的坐标是(x,y),矩形的宽和高(w,h) 5 x,y,w,h = 50,50,50,50 阅读全文
posted @ 2020-05-20 15:55 小他_W 阅读(197) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页