Skip to content

Index example#

What it does#

This example demonstrates how to create HNSW index from the batch of descriptors and use it to search for descriptor's closest matches efficiently.

Prerequisites#

This example assumes that you have already read the FaceEngine Handbook (or at least have it somewhere nearby for reference) and know some core concepts, like memory management, object ownership, and life-time control. This sample will not explain these aspects in detail.

It is advisable to read HNSW Index chapter before going through this example.

Note: hnsw index creation is not supported on embedded and 32-bit desktop platforms.

Example walkthrough#

To get familiar with FSDK usage and common practices, please go through example_extraction first.

How to run#

Use the following command to run the example.

./example_index_hnsw <image.ppm> <imagesDir> <list> <threshold>

Example output#

Images: "images/Cameron_Diaz.ppm" and "Cameron_Diaz.ppm" belong to one person.
Images: "images/Cameron_Diaz.ppm" and "Cameron_Diaz_2.ppm" belong to one person.
Images: "images/Cameron_Diaz.ppm" and "Jason_Statham.ppm" belong to different persons.
Images: "images/Cameron_Diaz.ppm" and "Jason_Statham_2.ppm" belong to different persons.
Images: "images/Cameron_Diaz.ppm" and "Jennifer_Aniston.ppm" belong to different persons.
Images: "images/Cameron_Diaz.ppm" and "Jennifer_Aniston_2.ppm" belong to different persons.
Back to top