2020-09-15 10:28:52 +02:00
|
|
|
import argparse
|
|
|
|
import face_recognition.comparison
|
2020-09-23 15:58:36 +02:00
|
|
|
import cv2
|
|
|
|
|
2020-09-15 10:28:52 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='Visualise face recognition algorithms.')
|
|
|
|
parser.add_argument('--camera', '-c', type=int, default=0,
|
|
|
|
help='Numeric id of the camera')
|
2020-09-23 15:58:36 +02:00
|
|
|
parser.add_argument('--fullscreen', '-f', action='store_true',
|
|
|
|
help='Display output full screen')
|
|
|
|
parser.add_argument('--clockwise', action='store_true',
|
|
|
|
help='Rotate clockwise')
|
|
|
|
parser.add_argument('--counter-clockwise', action='store_true',
|
|
|
|
help='Rotate counter clockwise')
|
|
|
|
parser.add_argument('--cascade', default='haarcascade_frontalface_alt2.xml',
|
|
|
|
help='Cascade XML file to use (opencv format)')
|
2020-09-23 17:18:10 +02:00
|
|
|
parser.add_argument('--output', default='saves',
|
|
|
|
help='Directory to store images (after pressing spacebar)')
|
2020-09-15 10:28:52 +02:00
|
|
|
|
|
|
|
args = parser.parse_args()
|
2020-09-23 15:58:36 +02:00
|
|
|
|
|
|
|
rotate = None
|
|
|
|
if args.clockwise:
|
|
|
|
rotate = cv2.ROTATE_90_CLOCKWISE
|
|
|
|
if args.counter_clockwise:
|
|
|
|
rotate = cv2.ROTATE_90_COUNTERCLOCKWISE
|
|
|
|
|
2020-09-23 17:18:10 +02:00
|
|
|
face_recognition.comparison.main(args.camera, rotate, args.fullscreen, args.cascade, args.output)
|