diff options
| author | adamhrv <adam@ahprojects.com> | 2018-12-23 01:24:24 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2018-12-23 01:24:24 +0100 |
| commit | 5340bee951c18910fd764241945f1f136b5a22b4 (patch) | |
| tree | 1e22866c36ef2bc04c53b5c4ccaeeba13f2e4cea /megapixels/commands/cv | |
| parent | 162246a0f1931428c85ab9a31ba42de9ef34dae3 (diff) | |
fixing face roi
Diffstat (limited to 'megapixels/commands/cv')
| -rw-r--r-- | megapixels/commands/cv/face_roi.py | 4 | ||||
| -rw-r--r-- | megapixels/commands/cv/face_vector.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/megapixels/commands/cv/face_roi.py b/megapixels/commands/cv/face_roi.py index d7248aee..a08566a8 100644 --- a/megapixels/commands/cv/face_roi.py +++ b/megapixels/commands/cv/face_roi.py @@ -115,7 +115,7 @@ def cli(ctx, opt_fp_in, opt_dir_media, opt_fp_out, opt_data_store, opt_dataset, data = [] for df_record in tqdm(df_records.itertuples(), total=len(df_records)): - fp_im = data_store.face_image(str(df_record.subdir), str(df_record.fn), str(df_record.ext)) + fp_im = data_store.face(str(df_record.subdir), str(df_record.fn), str(df_record.ext)) im = cv.imread(fp_im) # filter out color or grayscale iamges @@ -149,10 +149,10 @@ def cli(ctx, opt_fp_in, opt_dir_media, opt_fp_out, opt_data_store, opt_dataset, # debug display if opt_display and len(bboxes): - bbox_dim = bbox.to_dim(im.shape[:2][::-1]) # w,h im_md = im_utils.resize(im, width=min(1200, opt_size[0])) for bbox in bboxes: bbox_dim = bbox.to_dim(im_md.shape[:2][::-1]) + log.debug(f'bbox: {bbox_dim}') cv.rectangle(im_md, bbox_dim.pt_tl, bbox_dim.pt_br, (0,255,0), 3) cv.imshow('', im_md) while True: diff --git a/megapixels/commands/cv/face_vector.py b/megapixels/commands/cv/face_vector.py index cd816f9f..7200d73b 100644 --- a/megapixels/commands/cv/face_vector.py +++ b/megapixels/commands/cv/face_vector.py @@ -115,7 +115,7 @@ def cli(ctx, opt_fp_out, opt_dir_media, opt_data_store, opt_dataset, opt_size, # padding=opt_padding not yet implemented in 19.16 but merged in master vec = facerec.vec(im, bbox_dim, jitters=opt_jitters) vec_str = ','.join([repr(x) for x in vec]) # convert to string for CSV - vecs.append( {'roi_index': roi_index, 'image_index': image_index, 'vec': vec_str}) + vecs.append( {'roi_index': roi_index, 'record_index': image_index, 'vec': vec_str}) # save date |
