BasitAliii commited on
Commit
57618ee
·
verified ·
1 Parent(s): 6112eda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -6,6 +6,9 @@ from PIL import Image
6
  import io
7
  import os
8
 
 
 
 
9
  # Try to import FaceNet with error handling
10
  try:
11
  from facenet_pytorch import MTCNN, InceptionResnetV1
@@ -25,6 +28,7 @@ class FaceRecognitionSystem:
25
  print("✅ FaceNet models loaded successfully")
26
  except Exception as e:
27
  print(f"❌ Error loading FaceNet models: {e}")
 
28
  FACE_NET_AVAILABLE = False
29
 
30
  def setup_database(self):
@@ -355,6 +359,9 @@ with gr.Blocks(title="Face Recognition Attendance System") as demo:
355
  )
356
 
357
  with gr.Tab("ℹ️ System Info"):
 
 
 
358
  gr.Markdown("""
359
  ## About Face Recognition Attendance System
360
 
 
6
  import io
7
  import os
8
 
9
+ # Global variable for FaceNet availability
10
+ FACE_NET_AVAILABLE = False
11
+
12
  # Try to import FaceNet with error handling
13
  try:
14
  from facenet_pytorch import MTCNN, InceptionResnetV1
 
28
  print("✅ FaceNet models loaded successfully")
29
  except Exception as e:
30
  print(f"❌ Error loading FaceNet models: {e}")
31
+ global FACE_NET_AVAILABLE
32
  FACE_NET_AVAILABLE = False
33
 
34
  def setup_database(self):
 
359
  )
360
 
361
  with gr.Tab("ℹ️ System Info"):
362
+ status_msg = "✅ **System Status: FULLY OPERATIONAL**" if FACE_NET_AVAILABLE else "⚠️ **System Status: FACE RECOGNITION UNAVAILABLE**"
363
+ gr.Markdown(f"## System Status\n{status_msg}")
364
+
365
  gr.Markdown("""
366
  ## About Face Recognition Attendance System
367