Updated the code.
|
@ -19,8 +19,7 @@ storage = firebase.storage()
|
||||||
|
|
||||||
|
|
||||||
# Create account function which creates a new authentication info.
|
# Create account function which creates a new authentication info.
|
||||||
def create_account(username, password, confirm_password):
|
def create_account(email, password, confirm_password):
|
||||||
email = username + "@hotmail.com"
|
|
||||||
if password == confirm_password:
|
if password == confirm_password:
|
||||||
auth.create_user_with_email_and_password(email, password)
|
auth.create_user_with_email_and_password(email, password)
|
||||||
print("Account successfully created.")
|
print("Account successfully created.")
|
||||||
|
@ -29,8 +28,7 @@ def create_account(username, password, confirm_password):
|
||||||
|
|
||||||
|
|
||||||
# Login function which verifies the given authentication info.
|
# Login function which verifies the given authentication info.
|
||||||
def login(username, password):
|
def login(email, password):
|
||||||
email = username + "@hotmail.com"
|
|
||||||
try:
|
try:
|
||||||
auth.sign_in_with_email_and_password(email, password)
|
auth.sign_in_with_email_and_password(email, password)
|
||||||
print("Successfully Logged in.")
|
print("Successfully Logged in.")
|
||||||
|
@ -184,4 +182,4 @@ def reset_data():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
upload_signal_data("Batuhan", "Başoğlu", "bbaso079@uottawa.ca", "6138072241", "257 Lisgar Street")
|
upload_signal_data("RandomFirst", "RandomLast", "Random@gmail.com", "0000000000", "Random Address")
|
|
@ -29,4 +29,3 @@ def register_your_face(label):
|
||||||
cap.release()
|
cap.release()
|
||||||
cv2.destroyAllWindows()
|
cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,8 @@ def training_data_loader():
|
||||||
labelsMap[-1] = "unknown"
|
labelsMap[-1] = "unknown"
|
||||||
|
|
||||||
for i, subfolder in enumerate(subfolders):
|
for i, subfolder in enumerate(subfolders):
|
||||||
labelsMap[i] = os.path.basename(subfolder)
|
labelsMap[i] = DBHelper.get_firstname(os.path.basename(subfolder)) + "_" + DBHelper.get_lastname(
|
||||||
|
os.path.basename(subfolder))
|
||||||
for x in os.listdir(subfolder):
|
for x in os.listdir(subfolder):
|
||||||
xpath = os.path.join(subfolder, x)
|
xpath = os.path.join(subfolder, x)
|
||||||
if x.endswith('jpg') or x.endswith('pgm'):
|
if x.endswith('jpg') or x.endswith('pgm'):
|
||||||
|
@ -200,6 +201,7 @@ def face_recognition_inference(rec_type):
|
||||||
landmarks = np.array(landmarks)
|
landmarks = np.array(landmarks)
|
||||||
|
|
||||||
cond = False
|
cond = False
|
||||||
|
cond2 = False
|
||||||
|
|
||||||
if len(landmarks) == 68:
|
if len(landmarks) == 68:
|
||||||
x1Limit = landmarks[0][0] - (landmarks[36][0] - landmarks[0][0])
|
x1Limit = landmarks[0][0] - (landmarks[36][0] - landmarks[0][0])
|
||||||
|
@ -229,7 +231,7 @@ def face_recognition_inference(rec_type):
|
||||||
if cond:
|
if cond:
|
||||||
DBHelper.set_motor("on")
|
DBHelper.set_motor("on")
|
||||||
DBHelper.set_alarm("off")
|
DBHelper.set_alarm("off")
|
||||||
else:
|
elif not cond:
|
||||||
DBHelper.set_motor("off")
|
DBHelper.set_motor("off")
|
||||||
DBHelper.set_alarm("on")
|
DBHelper.set_alarm("on")
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 52 KiB |
BIN
Facial_images/face_rec/train/User_2/0.jpg
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
Facial_images/face_rec/train/User_2/1.jpg
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
Facial_images/face_rec/train/User_2/10.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/11.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/12.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/13.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/14.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/15.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/16.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
Facial_images/face_rec/train/User_2/17.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
Facial_images/face_rec/train/User_2/18.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
Facial_images/face_rec/train/User_2/19.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
Facial_images/face_rec/train/User_2/2.jpg
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
Facial_images/face_rec/train/User_2/3.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/4.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/5.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
Facial_images/face_rec/train/User_2/6.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/7.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/8.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
Facial_images/face_rec/train/User_2/9.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
|
@ -63,13 +63,11 @@ public class homepage extends AppCompatActivity {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if(check == 0){
|
if(check == 0){
|
||||||
sig.setPower("on");
|
sig.setPower("on");
|
||||||
sig.setMotor("on");
|
|
||||||
e.setImageResource(R.drawable.ic_power_on);
|
e.setImageResource(R.drawable.ic_power_on);
|
||||||
et.setText("ON");
|
et.setText("ON");
|
||||||
check = 1;
|
check = 1;
|
||||||
} else {
|
} else {
|
||||||
sig.setPower("off");
|
sig.setPower("off");
|
||||||
sig.setMotor("off");
|
|
||||||
e.setImageResource(R.drawable.ic_power_off);
|
e.setImageResource(R.drawable.ic_power_off);
|
||||||
et.setText("OFF");
|
et.setText("OFF");
|
||||||
check = 0;
|
check = 0;
|
||||||
|
|