-
Notifications
You must be signed in to change notification settings - Fork 0
/
step1.py
32 lines (31 loc) · 911 Bytes
/
step1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#---------------------------------------THIS IS STEP-1--------------------------------------------------------------------
import cv2
import pyttsx3
import mysql.connector as cs
def say(word):
engine = pyttsx3.init()
rate = engine.getProperty('rate')
engine.setProperty('rate', 120)
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
engine.say(word)
engine.runAndWait()
engine.stop()
camera = cv2.VideoCapture(0)
for i in range(61):
return_value, image = camera.read()
if i==60:
cv2.imwrite('owner'+str(i)+'.png', image)
del(camera)
say("enter your name")
n=str(input("enter your name:"))
say("enter passward of mysql")
passwd1=str(input("enter passward of mysql:"))
myfile1=open(r'name.txt','w')
myfile1.write(n)
myfile1.close()
myfile2=open('loginhistory.txt',"a")
n=n+'\n'
myfile2.write(n)
myfile2.close()
say("face data saved")