This commit is contained in:
Siwat Sirichai 2023-09-28 15:17:04 +07:00
parent 7285f9465b
commit 0f37b63456
7 changed files with 15 additions and 15 deletions

View File

@ -5,8 +5,8 @@ import requests
import json import json
#api_server = "http://localhost:5000" #api_server = "http://localhost:5000"
api_server = "http://192.168.0.239:5000" #api_server = "http://192.168.0.239:5000"
#api_server = "https://racist.siwatsystem.com" api_server = "https://racist.siwatsystem.com"
def analyze_face(img): def analyze_face(img):
endpoint = api_server +"/process_image" endpoint = api_server +"/process_image"

View File

@ -28,7 +28,7 @@ while True:
time.sleep(1) time.sleep(1)
#Try to identify face #Try to identify face
faces = fp.identify_face(img, target_condidence=0.4) faces = fp.identify_face(img, target_condidence=0.6)
if(len(faces)>0): if(len(faces)>0):
print("Door Unlocked!, Locking in 5 seconds") print("Door Unlocked!, Locking in 5 seconds")
stm32.unlock_door() stm32.unlock_door()

View File

@ -358,7 +358,7 @@ void startDoorHandleTask(void *argument) {
if (door_lock_state != door_lock_state_command) { if (door_lock_state != door_lock_state_command) {
if (door_lock_state_command == DOOR_LOCK_LOCKED) { if (door_lock_state_command == DOOR_LOCK_LOCKED) {
if (door_state == DOOR_STATE_CLOSED) { if (door_state == DOOR_STATE_CLOSED) {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
door_lock_state = DOOR_LOCK_LOCKED; door_lock_state = DOOR_LOCK_LOCKED;
door_lock_waiting = false; door_lock_waiting = false;
} else { } else {
@ -373,14 +373,14 @@ void startDoorHandleTask(void *argument) {
HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 1); HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 1);
} }
} else { } else {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
door_lock_waiting = false; door_lock_waiting = false;
door_lock_state = DOOR_LOCK_LOCKED; door_lock_state = DOOR_LOCK_LOCKED;
} }
} }
} }
} else if (door_lock_state_command == DOOR_LOCK_UNLOCKED) { } else if (door_lock_state_command == DOOR_LOCK_UNLOCKED) {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 0); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 0);
door_lock_state = DOOR_LOCK_UNLOCKED; door_lock_state = DOOR_LOCK_UNLOCKED;
door_lock_waiting = false; door_lock_waiting = false;
} }

View File

@ -974,10 +974,10 @@ void startDoorHandleTask(void *argument) {
800088a: 781b ldrb r3, [r3, #0] 800088a: 781b ldrb r3, [r3, #0]
800088c: 2b00 cmp r3, #0 800088c: 2b00 cmp r3, #0
800088e: d00c beq.n 80008aa <startDoorHandleTask+0x56> 800088e: d00c beq.n 80008aa <startDoorHandleTask+0x56>
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
8000890: 2201 movs r2, #1 8000890: 2201 movs r2, #1
8000892: 2100 movs r1, #0 8000892: f44f 7100 mov.w r1, #512 ; 0x200
8000894: f44f 7000 mov.w r0, #512 ; 0x200 8000896: 4846 ldr r0, [pc, #280] ; (80009b0 <startDoorHandleTask+0x15c>)
8000898: f000 fcb4 bl 8001204 <HAL_GPIO_WritePin> 8000898: f000 fcb4 bl 8001204 <HAL_GPIO_WritePin>
door_lock_state = DOOR_LOCK_LOCKED; door_lock_state = DOOR_LOCK_LOCKED;
800089c: 4b46 ldr r3, [pc, #280] ; (80009b8 <startDoorHandleTask+0x164>) 800089c: 4b46 ldr r3, [pc, #280] ; (80009b8 <startDoorHandleTask+0x164>)
@ -1037,10 +1037,10 @@ void startDoorHandleTask(void *argument) {
80008fc: e01f b.n 800093e <startDoorHandleTask+0xea> 80008fc: e01f b.n 800093e <startDoorHandleTask+0xea>
} }
} else { } else {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
80008fe: 2201 movs r2, #1 80008fe: 2201 movs r2, #1
8000900: 2100 movs r1, #0 8000900: f44f 7100 mov.w r1, #512 ; 0x200
8000902: f44f 7000 mov.w r0, #512 ; 0x200 8000904: 482a ldr r0, [pc, #168] ; (80009b0 <startDoorHandleTask+0x15c>)
8000906: f000 fc7d bl 8001204 <HAL_GPIO_WritePin> 8000906: f000 fc7d bl 8001204 <HAL_GPIO_WritePin>
door_lock_waiting = false; door_lock_waiting = false;
800090a: 4b2d ldr r3, [pc, #180] ; (80009c0 <startDoorHandleTask+0x16c>) 800090a: 4b2d ldr r3, [pc, #180] ; (80009c0 <startDoorHandleTask+0x16c>)
@ -1061,10 +1061,10 @@ void startDoorHandleTask(void *argument) {
8000920: b2db uxtb r3, r3 8000920: b2db uxtb r3, r3
8000922: 2b00 cmp r3, #0 8000922: 2b00 cmp r3, #0
8000924: d00b beq.n 800093e <startDoorHandleTask+0xea> 8000924: d00b beq.n 800093e <startDoorHandleTask+0xea>
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 0); HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 0);
8000926: 2200 movs r2, #0 8000926: 2200 movs r2, #0
8000928: 2100 movs r1, #0 8000928: f44f 7100 mov.w r1, #512 ; 0x200
800092a: f44f 7000 mov.w r0, #512 ; 0x200 800092c: 4820 ldr r0, [pc, #128] ; (80009b0 <startDoorHandleTask+0x15c>)
800092e: f000 fc69 bl 8001204 <HAL_GPIO_WritePin> 800092e: f000 fc69 bl 8001204 <HAL_GPIO_WritePin>
door_lock_state = DOOR_LOCK_UNLOCKED; door_lock_state = DOOR_LOCK_UNLOCKED;
8000932: 4b21 ldr r3, [pc, #132] ; (80009b8 <startDoorHandleTask+0x164>) 8000932: 4b21 ldr r3, [pc, #132] ; (80009b8 <startDoorHandleTask+0x164>)