Skip to main content

An attempt to build a package for forensic face examination

Project description

forensicface

This file will become your README and also the index of your documentation.

Install

pip install forensicface

ou:

conda install -c fastai forensicface

O arquivo onnx do modelo de detecção (det_10g.onnx) deve estar na pasta ~/.insightface/model/sepaelv2/

e o arquivo onnx do modelo de reconhecimento (adaface_ir101web12m.onnx) deve estar na pasta ~/.insightface/model/sepaelv2/adaface/

Como utilizar

Importação da classe ForensicFace:

from forensicface.app import ForensicFace

ff = ForensicFace(det_size=320, use_gpu=True)
Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', 'arena_extend_strategy': 'kNextPowerOfTwo', 'gpu_external_empty_cache': '0', 'gpu_external_free': '0', 'cudnn_conv_use_max_workspace': '0', 'gpu_mem_limit': '18446744073709551615', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'gpu_external_alloc': '0', 'device_id': '0'}}
find model: /home/rafael/.insightface/models/sepaelv2/det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
set det-size: (320, 320)

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("obama.png")
results.keys()
dict_keys(['keypoints', 'ipd', 'embedding', 'norm', 'aligned_face'])
plt.imshow(results['aligned_face'])
<matplotlib.image.AxesImage>

Comparar duas imagens faciais e obter o escore de similaridade.

ff.compare("obama.png","obama2.png")
0.8556125

Agregar embeddings de duas imagens faciais em uma única representação

agg = ff.aggregate_from_images(["obama.png","obama2.png"])
agg.shape
(512,)
help(ff.process_image)

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

forensicface-0.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

forensicface-0.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file forensicface-0.0.1.tar.gz.

File metadata

  • Download URL: forensicface-0.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for forensicface-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dd1588205a753e0d0d485f07e85ae3d915f18cbf594da92cbd6ffb5c54da4004
MD5 0d4d08b438205554e596ee1f9e7d265e
BLAKE2b-256 b85c0a542171d2a951e76361a08b8f0c6dd93abb84cd64451e07bf25044d9a3b

See more details on using hashes here.

File details

Details for the file forensicface-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for forensicface-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cebf44bfc7a619e376a64487b86739e7db1858c427ad00d236335349d5136b09
MD5 4745c86046b69aa5693d4acf2cfd28d8
BLAKE2b-256 0969ddb41391b54e78105b419bf0f832d2ce383436cb4c644135bff554e07e3b

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page