-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (25 loc) · 802 Bytes
/
main.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
"""
Detect FHP
"""
import os
import click
from face_recognition import face_locations
from anti_iHunch import FHPDetection
@click.command()
@click.option('--show', is_flag=True, default=False, help="show the video")
@click.option('--setting', is_flag=True, default=False, help="set configure")
def main(show, setting):
"""
start the detection of FHP
"""
fhp_detector = FHPDetection(show=show,
face_detector=face_locations,
config_file="config.json")
if not os.path.isfile("config.json") or setting:
print("setting mode")
fhp_detector.set_configure()
fhp_detector.show = True
fhp_detector.start_detection()
# pylint: disable=no-value-for-parameter
if __name__ == '__main__':
main()