diff options
| author | adamhrv <adam@ahprojects.com> | 2019-01-07 02:26:34 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-01-07 02:26:34 +0100 |
| commit | 5e5a7d09774bde195fe31ae143704eb124a764ac (patch) | |
| tree | 20e48a5f80e94c5021c01e9558de8af873e2eaf7 /megapixels/app/processors/face_detector.py | |
| parent | 4bcb82c0f295d79d3d247252e7e98b2d986ae821 (diff) | |
add demos, in progress
Diffstat (limited to 'megapixels/app/processors/face_detector.py')
| -rw-r--r-- | megapixels/app/processors/face_detector.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/megapixels/app/processors/face_detector.py b/megapixels/app/processors/face_detector.py index 6bf27576..c0762564 100644 --- a/megapixels/app/processors/face_detector.py +++ b/megapixels/app/processors/face_detector.py @@ -1,3 +1,4 @@ +import sys import os from os.path import join from pathlib import Path @@ -30,8 +31,6 @@ class DetectorMTCNN: :returns list of BBox ''' bboxes = [] - #conf_thresh = self.conf_thresh if conf_thresh is None else conf_thresh - #pyramids = self.pyramids if pyramids is None else pyramids dnn_size = self.dnn_size if size is None else size im = im_utils.resize(im, width=dnn_size[0], height=dnn_size[1]) @@ -72,6 +71,9 @@ class DetectorDLIBCNN: import dlib self.log = logger_utils.Logger.getLogger() cuda_visible_devices = os.getenv('CUDA_VISIBLE_DEVICES', '') + if dlib.DLIB_USE_CUDA and gpu < 0: + self.log.error('dlib was compiled with CUDA but you selected CPU. Use GPU >= 0 if dlib.DLIB_USE_CUDA') + sys.exit() os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu) self.log.info('load model: {}'.format(cfg.DIR_MODELS_DLIB_CNN)) self.detector = dlib.cnn_face_detection_model_v1(cfg.DIR_MODELS_DLIB_CNN) |
