Spaces:
Sleeping
Sleeping
Update modeles/insightface_template_utils.py
Browse files
modeles/insightface_template_utils.py
CHANGED
|
@@ -3,9 +3,13 @@ import cv2
|
|
| 3 |
import numpy as np
|
| 4 |
import insightface
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 7 |
model.prepare(ctx_id=0)
|
| 8 |
|
|
|
|
| 9 |
def create_insightface_template(folder_path, output_path):
|
| 10 |
embeddings = []
|
| 11 |
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import insightface
|
| 5 |
|
| 6 |
+
os.environ['INSIGHTFACE_HOME'] = '/tmp/insightface'
|
| 7 |
+
|
| 8 |
+
# Téléchargement du modèle dans le bon dossier
|
| 9 |
+
model = insightface.app.FaceAnalysis(name="buffalo_l", root=os.environ['INSIGHTFACE_HOME'], providers=["CPUExecutionProvider"])
|
| 10 |
model.prepare(ctx_id=0)
|
| 11 |
|
| 12 |
+
|
| 13 |
def create_insightface_template(folder_path, output_path):
|
| 14 |
embeddings = []
|
| 15 |
|