face_recognition/mirror.py

32 lines
1.5 KiB
Python
Raw Normal View History

import argparse
import face_recognition.comparison
import cv2
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')
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-10-02 16:52:34 +02:00
parser.add_argument('--output', metavar="DIRECTORY", default='saves',
2020-09-23 17:18:10 +02:00
help='Directory to store images (after pressing spacebar)')
2020-10-02 16:52:34 +02:00
parser.add_argument('--visualhaar-lib', metavar="LIBRARY", default=None,
help='path/filename for visualhaar library (.so on linux, .dll on windows)\nSee: https://git.rubenvandeven.com/r/visualhaar/releases')
args = parser.parse_args()
rotate = None
if args.clockwise:
rotate = cv2.ROTATE_90_CLOCKWISE
if args.counter_clockwise:
rotate = cv2.ROTATE_90_COUNTERCLOCKWISE
2020-10-02 16:52:34 +02:00
face_recognition.comparison.main(args.camera, rotate, args.fullscreen, args.cascade, args.output, args.visualhaar_lib)