isidentical Warlord-K commited on
Commit
2c3499e
1 Parent(s): 057b79a

Add usage example (#2)

Browse files

- Add usage example (686774cad65e40933022896195e07e01ee06bee9)


Co-authored-by: Yatharth Gupta <[email protected]>

Files changed (1) hide show
  1. README.md +29 -0
README.md CHANGED
@@ -25,6 +25,35 @@ The original ArcFace model and its theoretical foundation are described in the p
25
 
26
  AuraFace is a highly discriminative face recognition model designed using the Additive Angular Margin Loss approach. It builds upon the principles introduced in ArcFace and has been trained on commercially and publicly available data sources to enable its usage in commercial setting. AuraFace is tailored for scenarios requiring robust and accurate face recognition capabilities with minimal computational overhead.
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ## Intended Use
29
 
30
  ### Primary Use Cases
 
25
 
26
  AuraFace is a highly discriminative face recognition model designed using the Additive Angular Margin Loss approach. It builds upon the principles introduced in ArcFace and has been trained on commercially and publicly available data sources to enable its usage in commercial setting. AuraFace is tailored for scenarios requiring robust and accurate face recognition capabilities with minimal computational overhead.
27
 
28
+ ## Usage Example
29
+
30
+ To get a face embedding using AuraFace, it can be used via [InsightFace](https://github.com/deepinsight/insightface/tree/master) as shown in the example:
31
+
32
+ ```python
33
+ from huggingface_hub import snapshot_download
34
+ from insightface.app import FaceAnalysis
35
+ import numpy as np
36
+ import cv2
37
+
38
+ snapshot_download(
39
+ "fal/AuraFace-v1",
40
+ local_dir="models/auraface",
41
+ )
42
+ face_app = FaceAnalysis(
43
+ name="auraface",
44
+ providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
45
+ root=".",
46
+ )
47
+
48
+ input_image = cv2.imread("test.png")
49
+
50
+ cv2_image = np.array(input_image.convert("RGB"))
51
+
52
+ cv2_image = cv2_image[:, :, ::-1]
53
+ faces = face_app.get(cv2_image)
54
+ embedding = faces[0].normed_embedding
55
+ ```
56
+
57
  ## Intended Use
58
 
59
  ### Primary Use Cases