update model path
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import cv2
|
| 3 |
from insightface.app import FaceAnalysis
|
|
@@ -36,9 +37,8 @@ def facial_emotion_recognition(img):
|
|
| 36 |
return img
|
| 37 |
|
| 38 |
face_margin = 0.1
|
| 39 |
-
|
| 40 |
# Load the face detector
|
| 41 |
-
model_name = 'buffalo_sc'
|
| 42 |
face_detector = FaceAnalysis(name=model_name, allowed_modules=['detection'], providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
|
| 43 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
| 44 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
import cv2
|
| 4 |
from insightface.app import FaceAnalysis
|
|
|
|
| 37 |
return img
|
| 38 |
|
| 39 |
face_margin = 0.1
|
|
|
|
| 40 |
# Load the face detector
|
| 41 |
+
model_name = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'buffalo_sc')
|
| 42 |
face_detector = FaceAnalysis(name=model_name, allowed_modules=['detection'], providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
|
| 43 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
| 44 |
|