Updated the code.

This commit is contained in:
Batuhan Berk Başoğlu 2020-11-21 21:39:43 -05:00
parent d23753eba0
commit e22dca9ed8
51 changed files with 25720 additions and 44699 deletions

View file

@ -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")

View file

@ -29,4 +29,3 @@ def register_your_face(label):
cap.release() cap.release()
cv2.destroyAllWindows() cv2.destroyAllWindows()

View file

@ -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")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -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;

Binary file not shown.