summaryrefslogtreecommitdiff
path: root/megapixels/commands/cv/face_vector.py
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/commands/cv/face_vector.py')
-rw-r--r--megapixels/commands/cv/face_vector.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/megapixels/commands/cv/face_vector.py b/megapixels/commands/cv/face_vector.py
index 7c03205c..9251c053 100644
--- a/megapixels/commands/cv/face_vector.py
+++ b/megapixels/commands/cv/face_vector.py
@@ -103,15 +103,17 @@ def cli(ctx, opt_fp_out, opt_dir_media, opt_data_store, opt_dataset, opt_size,
# get face vector
bbox_dim = BBox.from_xywh(x, y, w, h).to_dim(dim) # convert to int real dimensions
# compute vec
- # padding=opt_padding not yet implemented in 19.16 but merged in master
+ # padding=opt_padding not yet implemented in dlib===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, 'record_index': record_index, 'vec': vec_str})
- # create dataframe
+ # create DataFrame and save to CSV
df = pd.DataFrame.from_dict(vecs)
df.index.name = 'index'
- # save CSV
file_utils.mkdirs(fp_out)
- df.to_csv(fp_out) \ No newline at end of file
+ df.to_csv(fp_out)
+
+ # save script
+ file_utils.write_text(' '.join(sys.argv), '{}.sh'.format(fp_out)) \ No newline at end of file