Skip to main content

insightfaceWrapper

Wrapper for easier inference for insightface

Install

pip install -U insightfacewrapper

Models

  • ms1mv3_arcface_r18
  • ms1mv3_arcface_r34
  • ms1mv3_arcface_r50
  • ms1mv3_arcface_r100
  • glint360k_cosface_r18
  • glint360k_cosface_r34
  • glint360k_cosface_r50
  • glint360k_cosface_r100
from insightfacewrapper.get_model import get_model
model = get_model(<model_name>)
model.eval()

Inference

Based on the original inference script, image should be resized to (112, 112).

def normalize(image: np.ndarray) -> np.ndarray:
    image /= 255
    image -= 0.5
    image /= 0.5
    return image

def image2input(image: np.ndarray) -> np.ndarray:
    transposed = np.transpose(image, (2, 0, 1)).astype(np.float32)
    return normalize(np.expand_dims(np.ascontiguousarray(transposed), 0))

torch_input = image2input(image)

with torch.inference_engine():
    result = model(torch_input)[0].cpu().numpy()

Metadata

Release files for insightfacewrapper 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for insightfacewrapper 0.0.4
File Size Uploaded
insightfacewrapper-0.0.4.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for insightfacewrapper 0.0.4
File Interpreter ABI Platform
insightfacewrapper-0.0.4-py3.8.egg Legacy Egg format - - Details

Total release size: 8.4 kB

Release files / insightfacewrapper-0.0.4.tar.gz

Download URL insightfacewrapper-0.0.4.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a0c18d4e4e31ed373eecce288e2664a73d22d78f32ad4e2eb8d5bce09a8be3ed
BLAKE2b-256 checksum
How to use checksums
81b01c4059b0cc262859ddc3f88029f3dff6f9a10c21bf3eadaa3d05fd6399d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release files / insightfacewrapper-0.0.4-py3.8.egg

Download URL insightfacewrapper-0.0.4-py3.8.egg
Size 3.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
f76cceadecc1a15a2da00cd8f9500d225cf7b9fc19cc29b60d23805589b9e1ea
BLAKE2b-256 checksum
How to use checksums
5ac35f2971a74f7cbad4421172f3dda749611918f4b77ee3cd689e4502807a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page