Skip to content

Commit c03300a

Browse files
committed
Cleanup
1 parent 098fe65 commit c03300a

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

agegenderemotion_webcam.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
:: camera resolution: 0-QVGA, 1-VGA, 2-HD, 3-FULLHD
44

5-
python agegenderemotion_webcam.py -h
5+
::python agegenderemotion_webcam.py -h
66

7-
python agegenderemotion_webcam.py --detector 0 --webcam 0 --resolution 0
7+
python agegenderemotion_webcam.py --detector 4 --webcam 0 --resolution 0
88

99

1010
pause

agegenderemotion_webcam.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def process_facedetection(model_detector, model_poseestimator, model_ageestimato
120120

121121
def run(cam_index, cam_resolution):
122122

123-
detector=FaceDetectorModels.HAARCASCADE
123+
# detector=FaceDetectorModels.HAARCASCADE
124124
# detector=FaceDetectorModels.DLIBHOG
125125
# detector=FaceDetectorModels.DLIBCNN
126126
# detector=FaceDetectorModels.SSDRESNET
127-
# detector=FaceDetectorModels.MTCNN
127+
detector=FaceDetectorModels.MTCNN
128128
# detector=FaceDetectorModels.FACENET
129129

130130
encoder=FaceEncoderModels.LBPH

enrollment.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import datetime
77
import math
8+
import imutils
89
from libfaceid.detector import FaceDetectorModels, FaceDetector
910
from libfaceid.encoder import FaceEncoderModels, FaceEncoder
1011
from libfaceid.classifier import FaceClassifierModels
@@ -109,7 +110,8 @@ def process_faceenrollment(model_detector, cam_index, cam_resolution):
109110
saveVideo = False
110111
out = None
111112
color_recording = (255,255,255)
112-
113+
is_windows = (os.name == 'nt')
114+
113115

114116
while (True):
115117

@@ -143,6 +145,8 @@ def process_faceenrollment(model_detector, cam_index, cam_resolution):
143145
cv2.line(fg, (s1[i,0], s1[i,1]), (s2[i,0], s2[i,1]), (0, 0, 0), 2, cv2.LINE_AA)
144146

145147
# Display updated frame
148+
if is_windows:
149+
fg = imutils.resize(fg, height=480)
146150
cv2.imshow(WINDOW_NAME, fg)
147151

148152
# Check for user actions
@@ -216,8 +220,9 @@ def run(cam_index, cam_resolution, name):
216220

217221
print("")
218222
print("Processing of video recording started...")
219-
video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
220-
video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
223+
# video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
224+
# video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
225+
video_to_images(detector, INPUT_DIR_DATASET, name)
221226
print("Processing of video recording completed!")
222227
print("Make sure to train the new datasets before testing!")
223228
print("")
@@ -245,8 +250,9 @@ def main(args):
245250

246251
print("")
247252
print("Processing of video recording started...")
248-
video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
249-
video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
253+
#video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
254+
#video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
255+
video_to_images(detector, INPUT_DIR_DATASET, name)
250256
print("Processing of video recording completed!")
251257
print("Make sure to train the new datasets before testing!")
252258
print("")

libfaceid/speech_synthesizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def synthesize_datasets(self, path_datasets):
4646

4747
def playaudio(self, path, name, block=True):
4848
try:
49-
if (name is not None) and (name != "Unknown"):
49+
if (name is not None) and (name != "Unknown") and (name != "Fake"):
5050
self._base.playaudio(path, name, block)
5151
except:
5252
print("SpeechSynthesizer playaudio EXCEPTION")

training.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
python training.py -h
77
::python training.py --detector 0 --encoder 0 --classifier 0
8-
python training.py --detector 4 --encoder 0 --classifier 0 --set_speech_synthesizer True --speech_synthesizer 0
8+
python training.py --detector 4 --encoder 1 --classifier 1 --set_speech_synthesizer True --speech_synthesizer 0
99
pause

0 commit comments

Comments
 (0)