Shafeek Saleem commited on
Commit
c1cf12f
·
1 Parent(s): da9147d
.idea/sonarlint/issuestore/0/0/000a6190576126fbf86ffdd96d384deeb366af79 ADDED
File without changes
.idea/sonarlint/issuestore/2/6/261359fd9dbbe29d2e8fa924e82dca6f103aeb4b ADDED
File without changes
.idea/sonarlint/issuestore/8/e/8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d ADDED
File without changes
.idea/sonarlint/issuestore/index.pb CHANGED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb771d2e71f1c7b0a253bccda5df0922f65c71590347796dd86cce5a272c9e0c
3
+ size 190
pages/4_Trying It Out.py CHANGED
@@ -30,15 +30,15 @@ def step4_page():
30
  )
31
  # Select input type
32
  st.info("Select your input type to analyze!")
33
- input_type = st.radio("Select the Input Type", ["Image", "Camera"])
34
  # Put slide to adjust tolerance
35
  tolerance = st.slider("Tolerance", 0.0, 1.0, 0.5, 0.01)
36
  st.info(
37
  "Tolerance is the threshold for face recognition. The lower the tolerance, the more strict the face recognition. The higher the tolerance, the more loose the face recognition.")
38
 
39
- if input_type == "Image":
40
  st.title("Face Recognition App")
41
- uploaded_images = st.file_uploader("Upload", type=['jpg', 'png', 'jpeg'], accept_multiple_files=True)
42
  if len(uploaded_images) != 0:
43
  # Read uploaded image with face_recognition
44
  for image in uploaded_images:
@@ -47,6 +47,16 @@ def step4_page():
47
  st.image(image)
48
  else:
49
  st.info("Please upload an image")
 
 
 
 
 
 
 
 
 
 
50
  else:
51
  st.title("Face Recognition App")
52
  # Camera Settings
 
30
  )
31
  # Select input type
32
  st.info("Select your input type to analyze!")
33
+ input_type = st.radio("Select the Input Type", ["Image upload", "Camera", "Live Video"])
34
  # Put slide to adjust tolerance
35
  tolerance = st.slider("Tolerance", 0.0, 1.0, 0.5, 0.01)
36
  st.info(
37
  "Tolerance is the threshold for face recognition. The lower the tolerance, the more strict the face recognition. The higher the tolerance, the more loose the face recognition.")
38
 
39
+ if input_type == "Image upload":
40
  st.title("Face Recognition App")
41
+ uploaded_images = st.file_uploader("Please upload image(s) to try it out!", type=['jpg', 'png', 'jpeg'], accept_multiple_files=True)
42
  if len(uploaded_images) != 0:
43
  # Read uploaded image with face_recognition
44
  for image in uploaded_images:
 
47
  st.image(image)
48
  else:
49
  st.info("Please upload an image")
50
+ elif input_type == "Camera":
51
+ st.title("Face Recognition App")
52
+ uploaded_image = st.camera_input("Take a picture")
53
+ if uploaded_image:
54
+ # Read uploaded image with face_recognition
55
+ image = face_recognition.load_image_file(uploaded_image)
56
+ image, name, face_id = recognize(image, tolerance)
57
+ st.image(image)
58
+ else:
59
+ st.info("Please take an image")
60
  else:
61
  st.title("Face Recognition App")
62
  # Camera Settings
utils/inference.py CHANGED
@@ -10,7 +10,6 @@ PKL_PATH = 'dataset/database.pkl'
10
 
11
  def recognize(image,tolerance):
12
  database = get_database(PKL_PATH)
13
- st.write(database)
14
  known_encoding = [database[id]['encoding'] for id in database.keys()]
15
  name = 'Unknown'
16
  face_id = 'Unknown'
 
10
 
11
  def recognize(image,tolerance):
12
  database = get_database(PKL_PATH)
 
13
  known_encoding = [database[id]['encoding'] for id in database.keys()]
14
  name = 'Unknown'
15
  face_id = 'Unknown'