-
Notifications
You must be signed in to change notification settings - Fork 4
/
verify_profile.py
50 lines (32 loc) · 1.06 KB
/
verify_profile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -----------------------------------------------------------------------------
# Import
# -----------------------------------------------------------------------------
import re
import os
import sys
from pathlib import Path
from time import time
from fnc.extractFeature import extractFeature
from fnc.matching import matching
arguments = {}
arguments["file"] = sys.argv[1]
arguments["temp_dir"] = "./templates/Profile_Iris/"
arguments["thres"] = 0.38
def main():
# -----------------------------------------------------------------------------
# Execution
# -----------------------------------------------------------------------------
# Extract feature
template, mask, file = extractFeature(arguments["file"])
# Matching
result = matching(
template, mask, arguments["temp_dir"], arguments["thres"])
if result == -1:
return "No registered sample"
elif result == 0:
return "No sample matched"
else:
result = result[0]
return result[:3]
if __name__ == '__main__':
print(main())