-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.py
More file actions
22 lines (19 loc) · 804 Bytes
/
run.py
File metadata and controls
22 lines (19 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import argparse
import threading
from faserver import app
from faserver.faceid.logic import face_recognition
if __name__ == "__main__":
# construct the argument parser and parse command line arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--ip", type=str, required=True,
help="ip address of the device")
ap.add_argument("-o", "--port", type=int, required=True,
help="ephemeral port number of the server (1024 to 65535)")
args = vars(ap.parse_args())
# start a thread that will perform face identification
t1 = threading.Thread(target=face_recognition)
t1.daemon = True
t1.start()
# start flask app
app.run(host=args["ip"], port=args["port"],
debug=True, threaded=True, use_reloader=False)