diff options
Diffstat (limited to 'megapixels/commands/cv/face_roi.py')
| -rw-r--r-- | megapixels/commands/cv/face_roi.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/megapixels/commands/cv/face_roi.py b/megapixels/commands/cv/face_roi.py index 70fff401..950936cf 100644 --- a/megapixels/commands/cv/face_roi.py +++ b/megapixels/commands/cv/face_roi.py @@ -33,7 +33,7 @@ color_filters = {'color': 1, 'gray': 2, 'all': 3} help='Output image size') @click.option('-d', '--detector', 'opt_detector_type', type=cfg.FaceDetectNetVar, - default=click_utils.get_default(types.FaceDetectNet.DLIB_CNN), + default=click_utils.get_default(types.FaceDetectNet.CVDNN), help=click_utils.show_help(types.FaceDetectNet)) @click.option('-g', '--gpu', 'opt_gpu', default=0, help='GPU index') @@ -97,8 +97,8 @@ def cli(ctx, opt_fp_in, opt_dir_media, opt_fp_out, opt_data_store, opt_dataset, detector = face_detector.DetectorDLIBCNN(gpu=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(gpu=opt_gpu) + elif opt_detector_type == types.FaceDetectNet.MTCNN_TF: + detector = face_detector.DetectorMTCNN_TF(gpu=opt_gpu) elif opt_detector_type == types.FaceDetectNet.HAAR: log.error('{} not yet implemented'.format(opt_detector_type.name)) return @@ -106,7 +106,7 @@ def cli(ctx, opt_fp_in, opt_dir_media, opt_fp_out, opt_data_store, opt_dataset, # get list of files to process fp_in = data_store.metadata(types.Metadata.FILE_RECORD) if opt_fp_in is None else opt_fp_in - df_records = pd.read_csv(fp_in).set_index('index') + df_records = pd.read_csv(fp_in, dtype={'fn':str}).set_index('index') if opt_slice: df_records = df_records[opt_slice[0]:opt_slice[1]] log.debug('processing {:,} files'.format(len(df_records))) @@ -144,9 +144,9 @@ def cli(ctx, opt_fp_in, opt_dir_media, opt_fp_out, opt_data_store, opt_dataset, for bbox in bboxes: roi = { 'record_index': int(df_record.Index), - 'x': bbox.x, - 'y': bbox.y, - 'w': bbox.w, + 'x': bbox.x, + 'y': bbox.y, + 'w': bbox.w, 'h': bbox.h } data.append(roi) |
