An attempt to build a package for forensic face examination
Project description
forensicface
Install
pip install forensicface
Os arquivos onnx dos modelos de detecção (det_10g.onnx), pose
(1k3d68.onnx) e gênero/idade (genderage.onnx) devem estar na pasta
~/.insightface/model/sepaelv2/
O arquivo onnx do modelo de reconhecimento (adaface_ir101web12m.onnx)
deve estar na pasta ~/.insightface/model/sepaelv2/adaface/
O arquivo onnx do modelo magface (magface_iresnet100.onnx) deve estar na
pasta ~/.insightface/model/sepaelv2/magface/
Como utilizar
Importação da classe ForensicFace:
from forensicface.app import ForensicFace
ff = ForensicFace(det_size=320, use_gpu=True)
Processamento básico de imagens
Obter pontos de referência, distância interpupilar, representação vetorial e a face alinhada com dimensão fixa (112x112)
results = ff.process_image_single_face("obama.png")
results.keys()
dict_keys(['keypoints', 'ipd', 'gender', 'age', 'pitch', 'yaw', 'roll', 'embedding', 'norm', 'magface_embedding', 'magface_norm', 'aligned_face'])
Comparar duas imagens faciais e obter o escore de similaridade.
ff.compare("obama.png","obama2.png")
0.8555868
Agregar embeddings de duas imagens faciais em uma única representação
agg = ff.aggregate_from_images(["obama.png","obama2.png"])
agg.shape
(512,)
Suporte a MagFace
Estimativa de qualidade pela norma da representação MagFace
good = ff.process_image("obama.png")
bad = ff.process_image("obama2.png")
good["magface_norm"], bad["magface_norm"]
(24.875765, 21.319853)
Crédito dos modelos utilizados
-
Detecção, gênero (M/F), idade e pose (pitch, yaw, roll): insightface
-
Estimativa de qualidade: MagFace
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file forensicface-0.0.7.tar.gz
.
File metadata
- Download URL: forensicface-0.0.7.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed8ac4758e6f57ca9949584185027fde0c2897ac190ab684db92f7d9a73f30e |
|
MD5 | d95ebf44ff97423aa5b4feb40a12bb1c |
|
BLAKE2b-256 | dada1efce9756f806cce484ee3be32471c74b0155a9a39c715403c4815c772d7 |
File details
Details for the file forensicface-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: forensicface-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c566774b141f881c05fb1ff4ac8e3b1e8aa1f4632abc8834ac668fd60b13c04 |
|
MD5 | 33d0c31b190ad29e7e3cdb8f71ea187b |
|
BLAKE2b-256 | 5438f32ea8cf054f6f846c0997afc55689e8f6c5df5120894e7bab5c13848f7d |