Metadata-Version: 2.1
Name: face-detector
Version: 0.2.1
Summary: State-of-the-art face detection and landmarks localization
Home-page: https://github.com/roj4s/face_detector
Author: Luis Rojas Aguilera
Author-email: rojas@icomp.ufam.edu.br
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: absl-py (==0.7.1)
Requires-Dist: astor (==0.7.1)
Requires-Dist: dlib (==19.17.0)
Requires-Dist: gast (==0.2.2)
Requires-Dist: grpcio (==1.19.0)
Requires-Dist: h5py (==2.9.0)
Requires-Dist: Keras-Applications (==1.0.7)
Requires-Dist: Keras-Preprocessing (==1.0.9)
Requires-Dist: Markdown (==3.0.1)
Requires-Dist: mock (==2.0.0)
Requires-Dist: numpy (==1.16.2)
Requires-Dist: opencv-python (==4.0.0.21)
Requires-Dist: pbr (==5.1.3)
Requires-Dist: pkg-resources (==0.0.0)
Requires-Dist: protobuf (==3.7.0)
Requires-Dist: six (==1.12.0)
Requires-Dist: tensorboard (==1.13.1)
Requires-Dist: tensorflow-estimator (==1.13.0)
Requires-Dist: tensorflow-gpu (==1.13.1)
Requires-Dist: termcolor (==1.1.0)
Requires-Dist: Werkzeug (==0.15.1)

# Face Detector

This python package provides state-of-the-art face detection as well as face
landmark points localization. It gathers the techniques implemented in dlib and
mtcnn[], which can be easily switched between by setting a parameter in the
FaceDetector class instantiation (mtcnn is default if no technique is
specified).

## How to use:

    from face_detector import FaceDetector

    #In next line, *faces* is an array of Face(BoundingBox, LandmarkPoints)
    faces = FaceDetector().get_faces(img_addr)

    # Show image with bounding boxes and landmarks
    import cv2
    img = cv2.imread(img_addr)

    for face in faces:
       bb = face.bounding_box
       landmarks = face.landmarks
       cv2.rectangle(img, (int(bb.x), int(bb.y)), (int(bb.x + bb.w), int(bb.y+bb.h)), (0, 255, 0), 1)
       for l in landmarks:
            cv2.circle(img, (l.x, l.y), 2, (0,0,255))

        cv2.imshow('img', img)
        cv2.waitKey(0)
        cv2.destroyAllWindows()

## How to install:

- From Github:
    - Clone this repository
    - Install dependencies in requirements.txt:
        - pip install -r requirements.txt
    - You might need to install zlib and link it on /usr/lib/x86_64-linux-gnu/libz.so:
        ```console
         foo@bar:~/face_detector$ tar xzvf data/zlib-1.2.9.tar.gz
         foo@bar:~/face_detector$ cd data/zlib
         foo@bar:~/face_detector/data/zlib$ sudo ./configure && make && make install
         foo@bar:~/face_detector/data/zlib$ ln -s /lib/x86_64-linux-gnu/libz.so.1.2.8 /usr/lib/x86_64-linux-gnu/libz.so
         ```

- TODO: A pip package being created





