Skip to main content

Overview

The CompareRequest model represents the input payload for the face comparison endpoint. It contains a target face image and a list of people to compare against.

Rust Definition

#[derive(Deserialize)]
pub struct CompareRequest {
    pub target_url: String,
    pub people: Vec<Person>,
}

TypeScript Definition

interface CompareRequest {
  target_url: string;
  people: Person[];
}

Fields

target_url
string
required
The URL of the target face image to compare against the provided people. This should be a publicly accessible image URL containing a face.
people
Person[]
required
An array of Person objects representing the individuals to compare against the target face. Each person includes a name and their image URL.

Example JSON

{
  "target_url": "https://example.com/images/target-face.jpg",
  "people": [
    {
      "name": "John Doe",
      "image_url": "https://example.com/images/john.jpg"
    },
    {
      "name": "Jane Smith",
      "image_url": "https://example.com/images/jane.jpg"
    },
    {
      "name": "Bob Johnson",
      "image_url": "https://example.com/images/bob.jpg"
    }
  ]
}

Usage

This model is used as the request body for the /compare endpoint. The API will:
  1. Download and process the target face image
  2. Download and process each person’s image
  3. Compare the target face against all provided people
  4. Return match results with probability scores
  • Person - Individual person model used in the people array
  • CompareResponse - Response model returned from the comparison

Build docs developers (and LLMs) love