Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
richmondu committed Jan 25, 2019
1 parent 098fe65 commit c03300a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions agegenderemotion_webcam.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

python agegenderemotion_webcam.py -h
::python agegenderemotion_webcam.py -h

python agegenderemotion_webcam.py --detector 0 --webcam 0 --resolution 0
python agegenderemotion_webcam.py --detector 4 --webcam 0 --resolution 0


pause
4 changes: 2 additions & 2 deletions agegenderemotion_webcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def process_facedetection(model_detector, model_poseestimator, model_ageestimato

def run(cam_index, cam_resolution):

detector=FaceDetectorModels.HAARCASCADE
# detector=FaceDetectorModels.HAARCASCADE
# detector=FaceDetectorModels.DLIBHOG
# detector=FaceDetectorModels.DLIBCNN
# detector=FaceDetectorModels.SSDRESNET
# detector=FaceDetectorModels.MTCNN
detector=FaceDetectorModels.MTCNN
# detector=FaceDetectorModels.FACENET

encoder=FaceEncoderModels.LBPH
Expand Down
16 changes: 11 additions & 5 deletions enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import datetime
import math
import imutils
from libfaceid.detector import FaceDetectorModels, FaceDetector
from libfaceid.encoder import FaceEncoderModels, FaceEncoder
from libfaceid.classifier import FaceClassifierModels
Expand Down Expand Up @@ -109,7 +110,8 @@ def process_faceenrollment(model_detector, cam_index, cam_resolution):
saveVideo = False
out = None
color_recording = (255,255,255)

is_windows = (os.name == 'nt')


while (True):

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

# Display updated frame
if is_windows:
fg = imutils.resize(fg, height=480)
cv2.imshow(WINDOW_NAME, fg)

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

print("")
print("Processing of video recording started...")
video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
# video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
# video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
video_to_images(detector, INPUT_DIR_DATASET, name)
print("Processing of video recording completed!")
print("Make sure to train the new datasets before testing!")
print("")
Expand Down Expand Up @@ -245,8 +250,9 @@ def main(args):

print("")
print("Processing of video recording started...")
video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
#video_to_images(detector, "x" + INPUT_DIR_DATASET, name)
#video_to_images(detector, INPUT_DIR_DATASET, name, one_image_only=True)
video_to_images(detector, INPUT_DIR_DATASET, name)
print("Processing of video recording completed!")
print("Make sure to train the new datasets before testing!")
print("")
Expand Down
2 changes: 1 addition & 1 deletion libfaceid/speech_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def synthesize_datasets(self, path_datasets):

def playaudio(self, path, name, block=True):
try:
if (name is not None) and (name != "Unknown"):
if (name is not None) and (name != "Unknown") and (name != "Fake"):
self._base.playaudio(path, name, block)
except:
print("SpeechSynthesizer playaudio EXCEPTION")
Expand Down
2 changes: 1 addition & 1 deletion training.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

python training.py -h
::python training.py --detector 0 --encoder 0 --classifier 0
python training.py --detector 4 --encoder 0 --classifier 0 --set_speech_synthesizer True --speech_synthesizer 0
python training.py --detector 4 --encoder 1 --classifier 1 --set_speech_synthesizer True --speech_synthesizer 0
pause

0 comments on commit c03300a

Please sign in to comment.