|
5 | 5 | import os |
6 | 6 | import datetime |
7 | 7 | import math |
| 8 | +import imutils |
8 | 9 | from libfaceid.detector import FaceDetectorModels, FaceDetector |
9 | 10 | from libfaceid.encoder import FaceEncoderModels, FaceEncoder |
10 | 11 | from libfaceid.classifier import FaceClassifierModels |
@@ -109,7 +110,8 @@ def process_faceenrollment(model_detector, cam_index, cam_resolution): |
109 | 110 | saveVideo = False |
110 | 111 | out = None |
111 | 112 | color_recording = (255,255,255) |
112 | | - |
| 113 | + is_windows = (os.name == 'nt') |
| 114 | + |
113 | 115 |
|
114 | 116 | while (True): |
115 | 117 |
|
@@ -143,6 +145,8 @@ def process_faceenrollment(model_detector, cam_index, cam_resolution): |
143 | 145 | cv2.line(fg, (s1[i,0], s1[i,1]), (s2[i,0], s2[i,1]), (0, 0, 0), 2, cv2.LINE_AA) |
144 | 146 |
|
145 | 147 | # Display updated frame |
| 148 | + if is_windows: |
| 149 | + fg = imutils.resize(fg, height=480) |
146 | 150 | cv2.imshow(WINDOW_NAME, fg) |
147 | 151 |
|
148 | 152 | # Check for user actions |
@@ -216,8 +220,9 @@ def run(cam_index, cam_resolution, name): |
216 | 220 |
|
217 | 221 | print("") |
218 | 222 | 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) |
221 | 226 | print("Processing of video recording completed!") |
222 | 227 | print("Make sure to train the new datasets before testing!") |
223 | 228 | print("") |
@@ -245,8 +250,9 @@ def main(args): |
245 | 250 |
|
246 | 251 | print("") |
247 | 252 | 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) |
250 | 256 | print("Processing of video recording completed!") |
251 | 257 | print("Make sure to train the new datasets before testing!") |
252 | 258 | print("") |
|
0 commit comments