hyfeng017 commited on
Commit
18e4ab3
·
1 Parent(s): fb1bbe2

Add employee_images folder with Git LFS

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,4 +1,4 @@
1
- # app.py
2
  import os # Import the os module
3
  import torch
4
  from facenet_pytorch import InceptionResnetV1, MTCNN
@@ -43,7 +43,7 @@ def register_images_facenet(model, image_dir):
43
  return embeddings
44
 
45
  # Load employee images and register them
46
- employee_images_dir = 'employees' # Ensure this directory is in the same directory as app.py
47
  facenet_embeddings = register_images_facenet(facenet_model, employee_images_dir)
48
 
49
  # Identify image function
@@ -70,4 +70,4 @@ def identify_image_facenet(model, embeddings, img, threshold=0.5):
70
  facenet_interface = gr.Interface(fn=identify_image_facenet, inputs="image", outputs="text", title="FaceNet Verification with Threshold 0.5")
71
 
72
  if _name_ == "_main_":
73
- facenet_interface.launch()
 
1
+
2
  import os # Import the os module
3
  import torch
4
  from facenet_pytorch import InceptionResnetV1, MTCNN
 
43
  return embeddings
44
 
45
  # Load employee images and register them
46
+ employee_images_dir = '/content/employees_images' # Ensure this directory is in the same directory as app.py
47
  facenet_embeddings = register_images_facenet(facenet_model, employee_images_dir)
48
 
49
  # Identify image function
 
70
  facenet_interface = gr.Interface(fn=identify_image_facenet, inputs="image", outputs="text", title="FaceNet Verification with Threshold 0.5")
71
 
72
  if _name_ == "_main_":
73
+ facenet_interface.launch()
requirements.txt CHANGED
@@ -1,3 +1,4 @@
 
1
  facenet-pytorch
2
  deepface
3
  gradio
@@ -5,4 +6,4 @@ mtcnn
5
  torch
6
  torchvision
7
  scikit-learn
8
- pillow
 
1
+
2
  facenet-pytorch
3
  deepface
4
  gradio
 
6
  torch
7
  torchvision
8
  scikit-learn
9
+ pillow