Shafeek Saleem commited on
Commit
aecd27b
1 Parent(s): 3157ae0
.idea/sonarlint/issuestore/2/6/261359fd9dbbe29d2e8fa924e82dca6f103aeb4b ADDED
File without changes
.idea/sonarlint/issuestore/index.pb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:87862bf18d4db63602fc54955aabfc69f91a027a381476ed3f14861ad89db28c
3
- size 254
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98baa20a68c7cd3b08884b0ec10d7c0e70c67528fd2364fbdef7501776bfd332
3
+ size 321
pages/3_Training the Model.py CHANGED
@@ -21,7 +21,7 @@ PKL_PATH = 'dataset/database.pkl'
21
 
22
  def step3_page():
23
  st.header("Training the Model")
24
- st.subheader("Face encoding")
25
  st.markdown(
26
  """
27
  ### What is Face Encoding?
@@ -59,17 +59,17 @@ def step3_page():
59
  face_name = img.split("_")[0]
60
  cols[i].image(os.path.join(img_dir, img), use_column_width=True)
61
  cols[i].write(face_name)
62
- st.info("Now it's your turn to train the model! Click on the button below to train the model with your data to generate face encodings!")
63
  if st.button("Train Model"):
64
- my_bar = st.progress(0, text="Training....")
65
  if len(images) > 0:
66
  database = get_database(PKL_PATH)
67
- for i in range(100):
68
- time.sleep(0.1)
69
- my_bar.progress(i, text="Training....")
70
- my_bar.progress(100, text="Successfully Trained!")
71
- st.success("Model trained successfully!")
72
- st.info("Now, lets generate face encodings for each face in known-face database using the model you just trained!")
73
  my_bar = st.progress(0, text="Generating face encodings...")
74
  for i, img in enumerate(images):
75
  face_image = face_recognition.load_image_file(os.path.join(img_dir, img))
@@ -87,7 +87,7 @@ def step3_page():
87
  'encoding': my_face_encoding}
88
  with open(PKL_PATH, 'wb') as f:
89
  pkl.dump(database, f)
90
- time.sleep(0.5)
91
  my_bar.progress(int((i + 1) / len(images) * 100), text="Generating face encodings...")
92
  my_bar.progress(100, text="Successfully encoded all the known faces!")
93
  st.success("Face encoding completed successfully!")
 
21
 
22
  def step3_page():
23
  st.header("Training the Model")
24
+ st.subheader("Face encoding and training")
25
  st.markdown(
26
  """
27
  ### What is Face Encoding?
 
59
  face_name = img.split("_")[0]
60
  cols[i].image(os.path.join(img_dir, img), use_column_width=True)
61
  cols[i].write(face_name)
62
+ st.info("Now it's your turn to train the model and generate face encodings! Click on the button below to train the model with your data to generate face encodings!")
63
  if st.button("Train Model"):
64
+ # my_bar = st.progress(0, text="Training....")
65
  if len(images) > 0:
66
  database = get_database(PKL_PATH)
67
+ # for i in range(100):
68
+ # time.sleep(0.1)
69
+ # my_bar.progress(i, text="Training....")
70
+ # my_bar.progress(100, text="Successfully Trained!")
71
+ # st.success("Model trained successfully!")
72
+ # st.info("Now, lets generate face encodings for each face in known-face database using the model you just trained!")
73
  my_bar = st.progress(0, text="Generating face encodings...")
74
  for i, img in enumerate(images):
75
  face_image = face_recognition.load_image_file(os.path.join(img_dir, img))
 
87
  'encoding': my_face_encoding}
88
  with open(PKL_PATH, 'wb') as f:
89
  pkl.dump(database, f)
90
+ time.sleep(1)
91
  my_bar.progress(int((i + 1) / len(images) * 100), text="Generating face encodings...")
92
  my_bar.progress(100, text="Successfully encoded all the known faces!")
93
  st.success("Face encoding completed successfully!")