Spaces:
Sleeping
Sleeping
Commit
·
4882360
1
Parent(s):
43503a9
Update app.py
Browse files
app.py
CHANGED
@@ -5,18 +5,7 @@ import os
|
|
5 |
from datetime import datetime
|
6 |
import gradio as gr
|
7 |
|
8 |
-
path = 'images'
|
9 |
-
images = []
|
10 |
-
personNames = []
|
11 |
-
myList = os.listdir(path)
|
12 |
-
unkownEncodings=[]
|
13 |
|
14 |
-
print(myList)
|
15 |
-
for cu_img in myList:
|
16 |
-
current_Img = cv2.imread(f'{path}/{cu_img}')
|
17 |
-
images.append(current_Img)
|
18 |
-
personNames.append(os.path.splitext(cu_img)[0])
|
19 |
-
print(personNames)
|
20 |
|
21 |
|
22 |
def faceEncodings(images):
|
@@ -27,13 +16,22 @@ def faceEncodings(images):
|
|
27 |
encodeList.append(encode)
|
28 |
return encodeList
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
encodeListKnown = faceEncodings(images)
|
33 |
-
print('All Encodings Complete!!!')
|
34 |
-
|
35 |
def Attandance(text,video,image):
|
36 |
names=[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
if video is not None:
|
38 |
cap = cv2.VideoCapture(video)
|
39 |
index=1
|
|
|
5 |
from datetime import datetime
|
6 |
import gradio as gr
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
def faceEncodings(images):
|
|
|
16 |
encodeList.append(encode)
|
17 |
return encodeList
|
18 |
|
|
|
|
|
|
|
|
|
|
|
19 |
def Attandance(text,video,image):
|
20 |
names=[]
|
21 |
+
path = 'images'
|
22 |
+
images = []
|
23 |
+
personNames = []
|
24 |
+
myList = os.listdir(path)
|
25 |
+
unkownEncodings=[]
|
26 |
+
|
27 |
+
print(myList)
|
28 |
+
for cu_img in myList:
|
29 |
+
current_Img = cv2.imread(f'{path}/{cu_img}')
|
30 |
+
images.append(current_Img)
|
31 |
+
personNames.append(os.path.splitext(cu_img)[0])
|
32 |
+
print(personNames)
|
33 |
+
encodeListKnown = faceEncodings(images)
|
34 |
+
print('All Encodings Complete!!!')
|
35 |
if video is not None:
|
36 |
cap = cv2.VideoCapture(video)
|
37 |
index=1
|