Skip to content

Commit

Permalink
perf: add scanning sensitivity in circle area for face to be detected…
Browse files Browse the repository at this point in the history
… by add minimum width face
  • Loading branch information
danieldanuega committed Jul 9, 2020
1 parent 099b7ed commit 8454726
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
Binary file added database/daniel/Jul-09-2020--17:37:25:220.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added database/erol/Jul-09-2020--17:17:52:544.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified database/representations.pkl
Binary file not shown.
4 changes: 2 additions & 2 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def findThreshold(model_name, distance_metric):
if distance_metric == 'cosine':
threshold = 0.23
elif distance_metric == 'euclidean':
# threshold = 35.6
threshold = 43
threshold = 35.6
# threshold = 43
elif distance_metric == 'euclidean_l2':
threshold = 0.52

Expand Down
6 changes: 4 additions & 2 deletions register.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
def register(database='./database', name='temp'):
now = datetime.now()
this_time = now.strftime("%b-%d-%Y--%H:%M:%S:%f")[:-3]

minWidthFace = 200

file_path = os.path.join(database,name)
r = 0
Expand All @@ -24,7 +26,7 @@ def register(database='./database', name='temp'):

faces = helper.detectFacesLive(frame)

if len(faces) != 0 and r != R:
if len(faces) != 0 and r != R and faces[0][2] >= minWidthFace:
x, y, w, h = faces[0]

# Draw rectangle in face
Expand All @@ -35,7 +37,7 @@ def register(database='./database', name='temp'):
2)

r += 1
elif len(faces) != 0 and r == R:
elif len(faces) != 0 and r == R and faces[0][2] >= minWidthFace:
r = 0
if os.path.exists(file_path) == False:
os.makedirs(file_path)
Expand Down
3 changes: 2 additions & 1 deletion rekog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def rekog():
f = 0
R = 0
r = 180
minWidthFace = 200
isFreeze = False


Expand Down Expand Up @@ -91,7 +92,7 @@ def rekog():
R = 0
isFreeze = False

if len(faces) != 0:
if len(faces) != 0 and faces[0][2] >= minWidthFace:
x, y, w, h = faces[0]

# Draw rectangle in face
Expand Down

0 comments on commit 8454726

Please sign in to comment.