README
This commit is contained in:
parent
7e33098759
commit
bf063c84d4
47
README.md
Normal file
47
README.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Biometrický prístupový systém
|
||||||
|
|
||||||
|
## Inštalácia
|
||||||
|
|
||||||
|
1. Naklonovať repozitár
|
||||||
|
```
|
||||||
|
$ git clone git@git.kemt.fei.tuke.sk:vj586da/recognition_system.git
|
||||||
|
```
|
||||||
|
2. Spustiť inštalačný skript
|
||||||
|
```
|
||||||
|
$ cd recognition_system/src
|
||||||
|
$ sudo ./setup.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Čo robí inštalačný skript?
|
||||||
|
1. Inštalačný skrip aktualizuje operačný systém.
|
||||||
|
2. Následne skontroluje či sa nachádza Python verzia 3.10. Ak sa nenachádza, skompiluje ju zo zdrojového kódu priloženého
|
||||||
|
v repozitári. V oficiálnych repozitároch napr. Debian Linuxu sa už Python3.10
|
||||||
|
nenachádza.
|
||||||
|
3. Vytvorí Python virtual environment, ktorý je potrebný pre inštaláciu Python
|
||||||
|
balíčkov, keďže je zakázaná globálna systémova inštalácia na nových systémoch
|
||||||
|
založených na Debian/Ubuntu.
|
||||||
|
4. Po aktivácii Python env sa nainštalujú potrebné balíčky z requirements.txt
|
||||||
|
5. Skopírujú sa SystemD service súbory z priečinka ./service a pomocou sed príkazu
|
||||||
|
sa nahradí aktívný používateľ - pripravia sa súbory.
|
||||||
|
6. Vytvorí sa symbolický link na dané service do /etc/systemd/system
|
||||||
|
7. Spraví sa SystemD daemon reload.
|
||||||
|
8. Povolia sa service, aby sa spúštali pri spustení systému.
|
||||||
|
9. Nainštaluje sa MariaDB server používaný pre logovanie overených používateľov.
|
||||||
|
10. Vytvorí sa používateľ *face_logger* s heslom *secret*
|
||||||
|
11. Pridajú sa mu potrebné práva
|
||||||
|
12. Zo súboru *schema.sql* sa importuje štruktúra databázy
|
||||||
|
|
||||||
|
|
||||||
|
## Náhľad používateľského rozhrania
|
||||||
|
### Prihlásenie
|
||||||
|

|
||||||
|
|
||||||
|
## Logy
|
||||||
|

|
||||||
|
|
||||||
|
## Pridanie tváre
|
||||||
|

|
||||||
|
|
||||||
|
## Zoznam tvárí
|
||||||
|

|
||||||
|
|
BIN
screenshots/add_face.png
Normal file
BIN
screenshots/add_face.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 KiB |
BIN
screenshots/login.png
Normal file
BIN
screenshots/login.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
screenshots/logs.png
Normal file
BIN
screenshots/logs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
BIN
screenshots/people_list.png
Normal file
BIN
screenshots/people_list.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
@ -12,6 +12,6 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||||||
ENCODINGS_PATH = os.path.join(SCRIPT_DIR, "encodings.pickle")
|
ENCODINGS_PATH = os.path.join(SCRIPT_DIR, "encodings.pickle")
|
||||||
LANDMARKS_PATH = os.path.join(SCRIPT_DIR, "shape_predictor_68_face_landmarks.dat")
|
LANDMARKS_PATH = os.path.join(SCRIPT_DIR, "shape_predictor_68_face_landmarks.dat")
|
||||||
|
|
||||||
THRESHOLD = 0.3
|
THRESHOLD = 0.4
|
||||||
COOLDOWN = 15
|
COOLDOWN = 15
|
||||||
CV_SCALER = 4
|
CV_SCALER = 4
|
||||||
|
@ -68,9 +68,11 @@ def process_frame(frame, known_face_encodings, known_face_names):
|
|||||||
face_distances = face_recognition.face_distance(known_face_encodings, face_encoding)
|
face_distances = face_recognition.face_distance(known_face_encodings, face_encoding)
|
||||||
if len(face_distances) > 0:
|
if len(face_distances) > 0:
|
||||||
best_match_index = np.argmin(face_distances)
|
best_match_index = np.argmin(face_distances)
|
||||||
name = known_face_names[best_match_index] if matches[best_match_index] else "Unknown"
|
best_distance = face_distances[best_match_index]
|
||||||
else:
|
if best_distance < THRESHOLD:
|
||||||
name = "Unknown"
|
name = known_face_names[best_match_index]
|
||||||
|
else:
|
||||||
|
name = "Unknown"
|
||||||
else:
|
else:
|
||||||
name = "Unknown"
|
name = "Unknown"
|
||||||
face_names.append(name)
|
face_names.append(name)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import pickle
|
import pickle
|
||||||
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from cryptography.fernet import Fernet
|
from cryptography.fernet import Fernet
|
||||||
@ -47,7 +48,7 @@ def delete_person(person_name, pickle_path="encodings.pickle", dataset_folder="d
|
|||||||
with open(pickle_path, "wb") as f:
|
with open(pickle_path, "wb") as f:
|
||||||
f.write(encrypted_data)
|
f.write(encrypted_data)
|
||||||
print(f"Deleted {count_deleted} entr{'y' if count_deleted == 1 else 'ies'} for person '{person_name}' from {pickle_path}.")
|
print(f"Deleted {count_deleted} entr{'y' if count_deleted == 1 else 'ies'} for person '{person_name}' from {pickle_path}.")
|
||||||
|
subprocess.run(["sudo", "systemctl", "restart", "face_rec"], check=True)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
Loading…
Reference in New Issue
Block a user