Metric learning models compute embeddings of their inputs, in such a way
that semantically similar samples are close in embedding space, and
dissimilar samples are far away.
In this context, samples annotated with the same identity are considered similar,
and the model will be trained to cluster their embeddings.
At inference time, one can perform classification using k-NN, or similarity search
using a vector database.
Datasets follow this structure:
endpoint_url/bucket
├── prefix/images/
├── prefix/annotations.yaml
└── prefix/metadata.yaml
Dataset images are placed directly inside images/ (subdirectories are ignored).
The metadata file looks something like
this:
task: metric learning
annotations: annotations.yaml
identities: [id1, id2, id3, id4, id5]
The annotations field specifies the name of
the file containing the ground truth annotations.
Here's an example of
annotations file:
000.jpg: id4
001.jpg: id2
002.jpg: id5
# ...