diff options
Diffstat (limited to 'megapixels/commands/cv/cluster.py')
| -rw-r--r-- | megapixels/commands/cv/cluster.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/megapixels/commands/cv/cluster.py b/megapixels/commands/cv/cluster.py index 94334133..419091a0 100644 --- a/megapixels/commands/cv/cluster.py +++ b/megapixels/commands/cv/cluster.py @@ -23,20 +23,20 @@ from app.utils.logger_utils import Logger @click.pass_context def cli(ctx, opt_data_store, opt_dataset, opt_metadata): """Display image info""" - - # cluster the embeddings -print("[INFO] clustering...") -clt = DBSCAN(metric="euclidean", n_jobs=args["jobs"]) -clt.fit(encodings) - -# determine the total number of unique faces found in the dataset -labelIDs = np.unique(clt.labels_) -numUniqueFaces = len(np.where(labelIDs > -1)[0]) -print("[INFO] # unique faces: {}".format(numUniqueFaces)) + + # cluster the embeddings + print("[INFO] clustering...") + clt = DBSCAN(metric="euclidean", n_jobs=args["jobs"]) + clt.fit(encodings) + + # determine the total number of unique faces found in the dataset + labelIDs = np.unique(clt.labels_) + numUniqueFaces = len(np.where(labelIDs > -1)[0]) + print("[INFO] # unique faces: {}".format(numUniqueFaces)) # load and display image im = cv.imread(fp_im) cv.imshow('', im) - + while True: k = cv.waitKey(1) & 0xFF if k == 27 or k == ord('q'): # ESC |
