summaryrefslogtreecommitdiff
path: root/megapixels/commands/cv/faces_to_csv.py
diff options
context:
space:
mode:
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('.',''),