7
7
from imutils .object_detection import non_max_suppression
8
8
9
9
subject_label = 1
10
- total_count = 0
11
- subject_one_count = 0
12
10
font = cv2 .FONT_HERSHEY_SIMPLEX
13
11
list_of_videos = []
14
12
cascade_path = "face_cascades/haarcascade_profileface.xml"
@@ -112,13 +110,12 @@ def put_label_on_face(frame, faces, labels):
112
110
args = vars (ap .parse_args ())
113
111
path = args ["videos" ]
114
112
for f in os .listdir (path ):
115
- list_of_videos = glob .glob (os .path .join (os .path .abspath (path ), f ) + "/*.mp4" )
113
+ list_of_videos = glob .glob (os .path .join (os .path .abspath (path ), f ))
116
114
print (os .path .join (os .path .abspath (path ), f ) + "*.mp4" )
117
115
print (list_of_videos )
118
116
if os .path .exists ("model.yaml" ):
119
117
recognizer .load ("model.yaml" )
120
118
for video in list_of_videos :
121
- print ("hello" )
122
119
camera = cv2 .VideoCapture (os .path .join (path , video ))
123
120
while True :
124
121
starttime = time .time ()
@@ -133,10 +130,7 @@ def put_label_on_face(frame, faces, labels):
133
130
frame_processed = draw_faces (frame_processed , faces )
134
131
label = recognize_face (frame_orginal , faces )
135
132
frame_processed = put_label_on_face (frame_processed , faces , label )
136
- for i in label :
137
- total_count = total_count + 1
138
- if i == 1 :
139
- subject_one_count = subject_one_count + 1
133
+
140
134
cv2 .imshow ("window" , frame_processed )
141
135
key = cv2 .waitKey (1 ) & 0xFF
142
136
if key == ord ("q" ):
0 commit comments