Skip to main content

Centroids

Every compiled face has a centroid, a summary of what the face was compiled on. Centroids are what make similarity search possible: you can ask which of your faces are alike, which are distinct, and how alike along several dimensions rather than just overall. Two endpoints use it: one compares a set of faces you name, the other searches for the closest or furthest matches to a single face.

Scores

A comparison returns a score under face. Scores run from -1 to 1. Higher is more alike. Only the scores are returned. A score involving a face you don’t own, including one shared with you or held in one of your groups, is given to one decimal place. When scores are rounded, neighbors are ordered by the rounded score, and rows with the same score are listed by owner, then alias (for furthest too, and for which rows make the top k). When the query face and every face searched are yours, scores and order are exact.

Compare several faces

Returns a symmetric matrix. Self-comparisons are omitted. Every face must be owned by you, and at least two are required (400 otherwise). A face with nothing compiled returns 422 naming it, including a face that holds only the attributes it was created with, or whose sources have all been reset. centroids_updated_at gives each face’s centroid time, as a Unix timestamp.

Find similar faces

Never returns the query face itself.
scope echoes back whatever you sent.

Search the published corpus

scope=published turns this into discovery: “faces like this one, from everyone”.
Only published faces are ever returned. Private faces do not appear in this scope, including your own. The query face can be any face you can read, not only one you own. Name someone else’s either way: the handle, or ?owner=:
Say which owner, if you own a face of the same name. A bare alias means your face first, so ?owner= or the handle is the difference between asking about head:socrates and asking about your own socrates. The giveaway that you asked the wrong question is the query face turning up in its own neighbour list. See naming a face you do not own.
The response says which face it answered about:
face is the resolved alias and owned_by the account it belongs to. The refusals name it too: a query face with nothing compiled returns 422 quoting head:socrates, not the string you sent, under the same rule as comparing faces. A face you cannot read returns 404, whether or not it exists, never 403.

Enough to draw a card

Each neighbour carries name, specialty, description, owned_by and basic_facts unconditionally. ?include= adds the rest, using the same vocabulary as the face list:
These are the same field names the face list uses.

When centroids are updated

A face’s centroid is recalculated each time a compile completes. A face that has never compiled, or whose sources have all been deleted, has no centroid and is left out of searches. Synthetic faces have no pre-computed centroid and are not included either.

Use cases

  • Cluster your library: see which faces are naturally alike or distinct.
  • Quality check: after compiling a new face, confirm it is actually distinct from the ones you already have rather than a near-duplicate.
  • Discovery: scope=published answers “more like this” against every published face.