houloude9 commited on
Commit
39e9736
·
verified ·
1 Parent(s): c2c7dd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -15,13 +15,15 @@ import gradio as gr
15
  warnings.filterwarnings('ignore')
16
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
17
 
18
- # Use PyTorch backend of InsightFace
19
  from insightface.app import FaceAnalysis
20
 
 
21
  class FacialRecognitionService:
22
  def __init__(self):
23
  """Initialize InsightFace model on CPU using PyTorch backend"""
24
  print("Loading InsightFace model (PyTorch, CPU)...")
 
25
  self.app = FaceAnalysis(name='buffalo_l', providers=['CPUExecutionProvider'])
26
  self.app.prepare(ctx_id=-1, det_size=(640, 640)) # CPU-only
27
  print("Model loaded ✅")
 
15
  warnings.filterwarnings('ignore')
16
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
17
 
18
+ # InsightFace PyTorch backend
19
  from insightface.app import FaceAnalysis
20
 
21
+
22
  class FacialRecognitionService:
23
  def __init__(self):
24
  """Initialize InsightFace model on CPU using PyTorch backend"""
25
  print("Loading InsightFace model (PyTorch, CPU)...")
26
+ # Lightweight CPU-friendly model
27
  self.app = FaceAnalysis(name='buffalo_l', providers=['CPUExecutionProvider'])
28
  self.app.prepare(ctx_id=-1, det_size=(640, 640)) # CPU-only
29
  print("Model loaded ✅")