diff --git a/DBHelper.py b/DBHelper.py index f7a47dac8..0c2e823f6 100644 --- a/DBHelper.py +++ b/DBHelper.py @@ -1,4 +1,7 @@ import pyrebase +import sys + +pwd = sys.path[0] firebaseConfig = { 'apiKey': "AIzaSyAdL0W5HscjEDFPK4BDi6Cnc7FLa30GPYY", @@ -9,7 +12,7 @@ firebaseConfig = { 'messagingSenderId': "163692530359", 'appId': "1:163692530359:web:b6dc7ccfc56a79afb11b32", 'measurementId': "G-EPWP2LK89Q", - 'serviceAccount': 'vehicleantitheftrecognition-firebase-adminsdk-krrgw-05da515de5.json' + 'serviceAccount': pwd + '/vehicleantitheftrecognition-firebase-adminsdk-krrgw-05da515de5.json' } firebase = pyrebase.initialize_app(firebaseConfig) diff --git a/Facial_Recognition_Inference.py b/Facial_Recognition_Inference.py index 88a12fea1..bd1e01371 100644 --- a/Facial_Recognition_Inference.py +++ b/Facial_Recognition_Inference.py @@ -26,7 +26,7 @@ def inference(): index = np.load(pwd + '/Facial_models/index.pkl', allow_pickle=True) faceDescriptorsEnrolled = np.load(pwd + '/Facial_models/descriptors.npy') - cam = cv2.VideoCapture(0) + cam = cv2.VideoCapture(1) count = 0 x1 = x2 = y1 = y2 = 0 @@ -81,14 +81,14 @@ def inference(): # print("time taken = {:.3f} seconds".format(time.time() - t)) - cv2.rectangle(im, (x1, y1), (x2, y2), (0, 255, 0), 2) - font_face = cv2.FONT_HERSHEY_SIMPLEX - font_scale = 0.8 - text_color = (0, 255, 0) - printLabel = '{} {:0.4f}'.format(label, minDistance) - cv2.putText(im, printLabel, (int(x1), int(y1)), font_face, font_scale, text_color, thickness=2) + cv2.rectangle(im, (x1, y1), (x2, y2), (0, 255, 0), 2) + font_face = cv2.FONT_HERSHEY_SIMPLEX + font_scale = 0.8 + text_color = (0, 255, 0) + printLabel = '{} {:0.4f}'.format(label, minDistance) + 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 if k == 27: diff --git a/Facial_models/descriptors.npy b/Facial_models/descriptors.npy index 458f8be5f..c244f9164 100644 Binary files a/Facial_models/descriptors.npy and b/Facial_models/descriptors.npy differ diff --git a/Facial_models/index.pkl b/Facial_models/index.pkl index 8b69409f3..1265dc6b0 100644 Binary files a/Facial_models/index.pkl and b/Facial_models/index.pkl differ diff --git a/Main.py b/Main.py index f956fa105..58338063f 100644 --- a/Main.py +++ b/Main.py @@ -1,5 +1,5 @@ import DBHelper -import Start_Engine +import start_engine import Upload_Face import Remove_Face import Check_Up @@ -10,7 +10,7 @@ if __name__ == "__main__": print("Starting the program.") while True: if DBHelper.get_power() == "on": - Start_Engine.start() + start_engine.start() if None not in (DBHelper.get_register_firstname(), DBHelper.get_register_lastname(), diff --git a/Photos_of_Thieves/Thief_1/0.jpg b/Photos_of_Thieves/Thief_1/0.jpg new file mode 100644 index 000000000..f29676e24 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/0.jpg differ diff --git a/Photos_of_Thieves/Thief_1/1.jpg b/Photos_of_Thieves/Thief_1/1.jpg new file mode 100644 index 000000000..f29676e24 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/1.jpg differ diff --git a/Photos_of_Thieves/Thief_1/10.jpg b/Photos_of_Thieves/Thief_1/10.jpg new file mode 100644 index 000000000..8c083339c Binary files /dev/null and b/Photos_of_Thieves/Thief_1/10.jpg differ diff --git a/Photos_of_Thieves/Thief_1/11.jpg b/Photos_of_Thieves/Thief_1/11.jpg new file mode 100644 index 000000000..4d4e5eb7c Binary files /dev/null and b/Photos_of_Thieves/Thief_1/11.jpg differ diff --git a/Photos_of_Thieves/Thief_1/12.jpg b/Photos_of_Thieves/Thief_1/12.jpg new file mode 100644 index 000000000..8c3a09565 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/12.jpg differ diff --git a/Photos_of_Thieves/Thief_1/13.jpg b/Photos_of_Thieves/Thief_1/13.jpg new file mode 100644 index 000000000..7b5632730 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/13.jpg differ diff --git a/Photos_of_Thieves/Thief_1/14.jpg b/Photos_of_Thieves/Thief_1/14.jpg new file mode 100644 index 000000000..1f4c7d46b Binary files /dev/null and b/Photos_of_Thieves/Thief_1/14.jpg differ diff --git a/Photos_of_Thieves/Thief_1/15.jpg b/Photos_of_Thieves/Thief_1/15.jpg new file mode 100644 index 000000000..d5564c6ed Binary files /dev/null and b/Photos_of_Thieves/Thief_1/15.jpg differ diff --git a/Photos_of_Thieves/Thief_1/16.jpg b/Photos_of_Thieves/Thief_1/16.jpg new file mode 100644 index 000000000..95e1d0a4f Binary files /dev/null and b/Photos_of_Thieves/Thief_1/16.jpg differ diff --git a/Photos_of_Thieves/Thief_1/17.jpg b/Photos_of_Thieves/Thief_1/17.jpg new file mode 100644 index 000000000..4e3b15f26 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/17.jpg differ diff --git a/Photos_of_Thieves/Thief_1/18.jpg b/Photos_of_Thieves/Thief_1/18.jpg new file mode 100644 index 000000000..26ab64a9b Binary files /dev/null and b/Photos_of_Thieves/Thief_1/18.jpg differ diff --git a/Photos_of_Thieves/Thief_1/19.jpg b/Photos_of_Thieves/Thief_1/19.jpg new file mode 100644 index 000000000..a7487eecb Binary files /dev/null and b/Photos_of_Thieves/Thief_1/19.jpg differ diff --git a/Photos_of_Thieves/Thief_1/2.jpg b/Photos_of_Thieves/Thief_1/2.jpg new file mode 100644 index 000000000..55bb02b7e Binary files /dev/null and b/Photos_of_Thieves/Thief_1/2.jpg differ diff --git a/Photos_of_Thieves/Thief_1/20.jpg b/Photos_of_Thieves/Thief_1/20.jpg new file mode 100644 index 000000000..af88c88a5 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/20.jpg differ diff --git a/Photos_of_Thieves/Thief_1/21.jpg b/Photos_of_Thieves/Thief_1/21.jpg new file mode 100644 index 000000000..664593b89 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/21.jpg differ diff --git a/Photos_of_Thieves/Thief_1/22.jpg b/Photos_of_Thieves/Thief_1/22.jpg new file mode 100644 index 000000000..214e8a427 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/22.jpg differ diff --git a/Photos_of_Thieves/Thief_1/23.jpg b/Photos_of_Thieves/Thief_1/23.jpg new file mode 100644 index 000000000..7f597dc1c Binary files /dev/null and b/Photos_of_Thieves/Thief_1/23.jpg differ diff --git a/Photos_of_Thieves/Thief_1/24.jpg b/Photos_of_Thieves/Thief_1/24.jpg new file mode 100644 index 000000000..c7cb77521 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/24.jpg differ diff --git a/Photos_of_Thieves/Thief_1/25.jpg b/Photos_of_Thieves/Thief_1/25.jpg new file mode 100644 index 000000000..a7227b72c Binary files /dev/null and b/Photos_of_Thieves/Thief_1/25.jpg differ diff --git a/Photos_of_Thieves/Thief_1/26.jpg b/Photos_of_Thieves/Thief_1/26.jpg new file mode 100644 index 000000000..eed27d805 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/26.jpg differ diff --git a/Photos_of_Thieves/Thief_1/27.jpg b/Photos_of_Thieves/Thief_1/27.jpg new file mode 100644 index 000000000..af5cba06a Binary files /dev/null and b/Photos_of_Thieves/Thief_1/27.jpg differ diff --git a/Photos_of_Thieves/Thief_1/28.jpg b/Photos_of_Thieves/Thief_1/28.jpg new file mode 100644 index 000000000..c2e396372 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/28.jpg differ diff --git a/Photos_of_Thieves/Thief_1/29.jpg b/Photos_of_Thieves/Thief_1/29.jpg new file mode 100644 index 000000000..ec7e6e081 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/29.jpg differ diff --git a/Photos_of_Thieves/Thief_1/3.jpg b/Photos_of_Thieves/Thief_1/3.jpg new file mode 100644 index 000000000..c80eb6d49 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/3.jpg differ diff --git a/Photos_of_Thieves/Thief_1/30.jpg b/Photos_of_Thieves/Thief_1/30.jpg new file mode 100644 index 000000000..55fe7d8ad Binary files /dev/null and b/Photos_of_Thieves/Thief_1/30.jpg differ diff --git a/Photos_of_Thieves/Thief_1/31.jpg b/Photos_of_Thieves/Thief_1/31.jpg new file mode 100644 index 000000000..516bde7c0 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/31.jpg differ diff --git a/Photos_of_Thieves/Thief_1/32.jpg b/Photos_of_Thieves/Thief_1/32.jpg new file mode 100644 index 000000000..0e8aa03ef Binary files /dev/null and b/Photos_of_Thieves/Thief_1/32.jpg differ diff --git a/Photos_of_Thieves/Thief_1/33.jpg b/Photos_of_Thieves/Thief_1/33.jpg new file mode 100644 index 000000000..0b40014fb Binary files /dev/null and b/Photos_of_Thieves/Thief_1/33.jpg differ diff --git a/Photos_of_Thieves/Thief_1/34.jpg b/Photos_of_Thieves/Thief_1/34.jpg new file mode 100644 index 000000000..f8fc9c147 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/34.jpg differ diff --git a/Photos_of_Thieves/Thief_1/35.jpg b/Photos_of_Thieves/Thief_1/35.jpg new file mode 100644 index 000000000..95f927bdd Binary files /dev/null and b/Photos_of_Thieves/Thief_1/35.jpg differ diff --git a/Photos_of_Thieves/Thief_1/36.jpg b/Photos_of_Thieves/Thief_1/36.jpg new file mode 100644 index 000000000..3b190bdba Binary files /dev/null and b/Photos_of_Thieves/Thief_1/36.jpg differ diff --git a/Photos_of_Thieves/Thief_1/37.jpg b/Photos_of_Thieves/Thief_1/37.jpg new file mode 100644 index 000000000..2a4b6a4ff Binary files /dev/null and b/Photos_of_Thieves/Thief_1/37.jpg differ diff --git a/Photos_of_Thieves/Thief_1/38.jpg b/Photos_of_Thieves/Thief_1/38.jpg new file mode 100644 index 000000000..0896e4805 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/38.jpg differ diff --git a/Photos_of_Thieves/Thief_1/4.jpg b/Photos_of_Thieves/Thief_1/4.jpg new file mode 100644 index 000000000..06cd85c61 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/4.jpg differ diff --git a/Photos_of_Thieves/Thief_1/5.jpg b/Photos_of_Thieves/Thief_1/5.jpg new file mode 100644 index 000000000..59f498281 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/5.jpg differ diff --git a/Photos_of_Thieves/Thief_1/6.jpg b/Photos_of_Thieves/Thief_1/6.jpg new file mode 100644 index 000000000..7cd62d845 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/6.jpg differ diff --git a/Photos_of_Thieves/Thief_1/7.jpg b/Photos_of_Thieves/Thief_1/7.jpg new file mode 100644 index 000000000..2ed802e87 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/7.jpg differ diff --git a/Photos_of_Thieves/Thief_1/8.jpg b/Photos_of_Thieves/Thief_1/8.jpg new file mode 100644 index 000000000..ec16b6f5a Binary files /dev/null and b/Photos_of_Thieves/Thief_1/8.jpg differ diff --git a/Photos_of_Thieves/Thief_1/9.jpg b/Photos_of_Thieves/Thief_1/9.jpg new file mode 100644 index 000000000..20a2874c8 Binary files /dev/null and b/Photos_of_Thieves/Thief_1/9.jpg differ diff --git a/__pycache__/Check_Up.cpython-38.pyc b/__pycache__/Check_Up.cpython-38.pyc new file mode 100644 index 000000000..eb29456d9 Binary files /dev/null and b/__pycache__/Check_Up.cpython-38.pyc differ diff --git a/__pycache__/DBHelper.cpython-38.pyc b/__pycache__/DBHelper.cpython-38.pyc new file mode 100644 index 000000000..8c533f0c2 Binary files /dev/null and b/__pycache__/DBHelper.cpython-38.pyc differ diff --git a/__pycache__/Facial_Recognition_Enrollment.cpython-38.pyc b/__pycache__/Facial_Recognition_Enrollment.cpython-38.pyc index 64c109dbe..fa89a42e7 100644 Binary files a/__pycache__/Facial_Recognition_Enrollment.cpython-38.pyc and b/__pycache__/Facial_Recognition_Enrollment.cpython-38.pyc differ diff --git a/__pycache__/Facial_Recognition_Inference.cpython-38.pyc b/__pycache__/Facial_Recognition_Inference.cpython-38.pyc new file mode 100644 index 000000000..c2ed5b94b Binary files /dev/null and b/__pycache__/Facial_Recognition_Inference.cpython-38.pyc differ diff --git a/__pycache__/Facial_Recognition_Registration.cpython-38.pyc b/__pycache__/Facial_Recognition_Registration.cpython-38.pyc new file mode 100644 index 000000000..93209b21b Binary files /dev/null and b/__pycache__/Facial_Recognition_Registration.cpython-38.pyc differ diff --git a/__pycache__/Facial_Recognition_Thief_Registration.cpython-38.pyc b/__pycache__/Facial_Recognition_Thief_Registration.cpython-38.pyc new file mode 100644 index 000000000..d4aabe24a Binary files /dev/null and b/__pycache__/Facial_Recognition_Thief_Registration.cpython-38.pyc differ diff --git a/__pycache__/Remove_Face.cpython-38.pyc b/__pycache__/Remove_Face.cpython-38.pyc new file mode 100644 index 000000000..8cb206559 Binary files /dev/null and b/__pycache__/Remove_Face.cpython-38.pyc differ diff --git a/__pycache__/Upload_Face.cpython-38.pyc b/__pycache__/Upload_Face.cpython-38.pyc new file mode 100644 index 000000000..17e2f71ad Binary files /dev/null and b/__pycache__/Upload_Face.cpython-38.pyc differ diff --git a/__pycache__/Upload_Thief.cpython-38.pyc b/__pycache__/Upload_Thief.cpython-38.pyc new file mode 100644 index 000000000..5e23f8f6d Binary files /dev/null and b/__pycache__/Upload_Thief.cpython-38.pyc differ diff --git a/__pycache__/start_engine.cpython-38.pyc b/__pycache__/start_engine.cpython-38.pyc new file mode 100644 index 000000000..201695a79 Binary files /dev/null and b/__pycache__/start_engine.cpython-38.pyc differ