Skip to main content

a simple implmentation for face align

Project description

simple-face-alignment

a simple face alignment, standard face size is 96x112

example example image is https://github.com/wrenchzc/simple-face-alignment/blob/main/tests/ty1.jpg

before align

no align

use 5 point affine

5 point align

use 3 point affine

3 point align

###INSTALLATION

Currently it is only supported Python3.4 onwards. It can be installed through pip:

$ pip install simple-face-alignment

This implementation requires OpenCV>=4.1

USAGE

The following example illustrates the ease of use of this package:

>>> from simple_face_alignment import align_face, ALIGN_METHOD_3POINT
>>>
>>> img = cv2.imread("ty1.jpg")
>>> # detector result should include a bbox and a landmark
>>> # bbox is x, y, r, b, landmark is left eye, right eye, nose, mouse left, mouse right
>>> bbox = [409.89, 230.20, 725.06, 557.34]
>>> landmark = [(497.8352508544922, 394.51161527633667), (610.6470794677734, 335.02099990844727),
                (588.0000686645508, 446.7395896911621), (567.606155872345, 543.8972625732422),
                (643.1047439575195, 437.53148651123047)]
>>> face_aligned = align_face(img, landmark, bbox)

LICENSE

MIT License

REFERENCE

从零开始搭建人脸识别系统(二):人脸对齐

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_face_alignment-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file simple_face_alignment-0.0.2.tar.gz.

File metadata

  • Download URL: simple_face_alignment-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.6.12

File hashes

Hashes for simple_face_alignment-0.0.2.tar.gz
Algorithm Hash digest
SHA256 980977b1a452b13891489704377d353aa3d6d4a58f728cda7db852642662dc54
MD5 238443dfada6649378d5467cb74cb9d8
BLAKE2b-256 1db4a602c9270dc5337bce60c0f4aae0a6c530e4022d8ee82759f2697b268780

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page