Fix crash problem

This commit is contained in:
Feier Zhang 2021-02-17 22:35:44 -05:00
parent fbfc071aba
commit 0c0449bacc
54 changed files with 14 additions and 11 deletions

View file

@ -1,4 +1,7 @@
import pyrebase import pyrebase
import sys
pwd = sys.path[0]
firebaseConfig = { firebaseConfig = {
'apiKey': "AIzaSyAdL0W5HscjEDFPK4BDi6Cnc7FLa30GPYY", 'apiKey': "AIzaSyAdL0W5HscjEDFPK4BDi6Cnc7FLa30GPYY",
@ -9,7 +12,7 @@ firebaseConfig = {
'messagingSenderId': "163692530359", 'messagingSenderId': "163692530359",
'appId': "1:163692530359:web:b6dc7ccfc56a79afb11b32", 'appId': "1:163692530359:web:b6dc7ccfc56a79afb11b32",
'measurementId': "G-EPWP2LK89Q", 'measurementId': "G-EPWP2LK89Q",
'serviceAccount': 'vehicleantitheftrecognition-firebase-adminsdk-krrgw-05da515de5.json' 'serviceAccount': pwd + '/vehicleantitheftrecognition-firebase-adminsdk-krrgw-05da515de5.json'
} }
firebase = pyrebase.initialize_app(firebaseConfig) firebase = pyrebase.initialize_app(firebaseConfig)

View file

@ -26,7 +26,7 @@ def inference():
index = np.load(pwd + '/Facial_models/index.pkl', allow_pickle=True) index = np.load(pwd + '/Facial_models/index.pkl', allow_pickle=True)
faceDescriptorsEnrolled = np.load(pwd + '/Facial_models/descriptors.npy') faceDescriptorsEnrolled = np.load(pwd + '/Facial_models/descriptors.npy')
cam = cv2.VideoCapture(0) cam = cv2.VideoCapture(1)
count = 0 count = 0
x1 = x2 = y1 = y2 = 0 x1 = x2 = y1 = y2 = 0
@ -81,14 +81,14 @@ def inference():
# print("time taken = {:.3f} seconds".format(time.time() - t)) # print("time taken = {:.3f} seconds".format(time.time() - t))
cv2.rectangle(im, (x1, y1), (x2, y2), (0, 255, 0), 2) cv2.rectangle(im, (x1, y1), (x2, y2), (0, 255, 0), 2)
font_face = cv2.FONT_HERSHEY_SIMPLEX font_face = cv2.FONT_HERSHEY_SIMPLEX
font_scale = 0.8 font_scale = 0.8
text_color = (0, 255, 0) text_color = (0, 255, 0)
printLabel = '{} {:0.4f}'.format(label, minDistance) printLabel = '{} {:0.4f}'.format(label, minDistance)
cv2.putText(im, printLabel, (int(x1), int(y1)), font_face, font_scale, text_color, thickness=2) cv2.putText(im, printLabel, (int(x1), int(y1)), font_face, font_scale, text_color, thickness=2)
cv2.imshow('img', im) cv2.imshow('img', im)
k = cv2.waitKey(1) & 0xff k = cv2.waitKey(1) & 0xff
if k == 27: if k == 27:

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,5 @@
import DBHelper import DBHelper
import Start_Engine import start_engine
import Upload_Face import Upload_Face
import Remove_Face import Remove_Face
import Check_Up import Check_Up
@ -10,7 +10,7 @@ if __name__ == "__main__":
print("Starting the program.") print("Starting the program.")
while True: while True:
if DBHelper.get_power() == "on": if DBHelper.get_power() == "on":
Start_Engine.start() start_engine.start()
if None not in (DBHelper.get_register_firstname(), if None not in (DBHelper.get_register_firstname(),
DBHelper.get_register_lastname(), DBHelper.get_register_lastname(),

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.