summaryrefslogtreecommitdiff
path: root/megapixels/commands/cv/faces_to_csv.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-12-13 18:13:55 +0100
committerJules Laplace <julescarbon@gmail.com>2018-12-13 18:13:55 +0100
commit3ab28a3ff3d0e1b71f123e38ce3d0df42caddc7c (patch)
tree5ec327f62304c93583d982d20e2e92e7d0fa6f57 /megapixels/commands/cv/faces_to_csv.py
parentd1da6ed6b0a6911c3b24e012ea051c9253ce8479 (diff)
parentbd51b3cdf474c93b1d7c667d9e5a33159c97640a (diff)
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'megapixels/commands/cv/faces_to_csv.py')
-rw-r--r--megapixels/commands/cv/faces_to_csv.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/megapixels/commands/cv/faces_to_csv.py b/megapixels/commands/cv/faces_to_csv.py
index 07226c31..1fd47571 100644
--- a/megapixels/commands/cv/faces_to_csv.py
+++ b/megapixels/commands/cv/faces_to_csv.py
@@ -30,7 +30,7 @@ color_filters = {'color': 1, 'gray': 2, 'all': 3}
help='GPU index')
@click.option('--conf', 'opt_conf_thresh', default=0.85, type=click.FloatRange(0,1),
help='Confidence minimum threshold')
-@click.option('--pyramids', 'opt_pyramids', default=0, type=click.IntRange(0,4),
+@click.option('-p', '--pyramids', 'opt_pyramids', default=0, type=click.IntRange(0,4),
help='Number pyramids to upscale for DLIB detectors')
@click.option('--slice', 'opt_slice', type=(int, int), default=(None, None),
help='Slice list of files')
@@ -78,6 +78,8 @@ def cli(ctx, opt_dirs_in, opt_fp_out, opt_ext, opt_size, opt_detector_type,
detector = face_detector.DetectorDLIBCNN(opt_gpu)
elif opt_detector_type == types.FaceDetectNet.DLIB_HOG:
detector = face_detector.DetectorDLIBHOG()
+ elif opt_detector_type == types.FaceDetectNet.MTCNN:
+ detector = face_detector.DetectorMTCNN()
elif opt_detector_type == types.FaceDetectNet.HAAR:
log.error('{} not yet implemented'.format(opt_detector_type.name))
return
@@ -129,6 +131,8 @@ def cli(ctx, opt_dirs_in, opt_fp_out, opt_ext, opt_size, opt_detector_type,
subdir = str(fpp_im.parent.relative_to(opt_dir_in))
for bbox in bboxes:
+ # log.debug('is square: {}'.format(bbox.w == bbox.h))
+ nw,nh = int(bbox.w * im.shape[1]), int(bbox.h * im.shape[0])
roi = {
'fn': fpp_im.stem,
'ext': fpp_im.suffix.replace('.',''),