Skip to main content
Version: v1.2

Human Re-identification (ReID)

Use this feature to identify and track specific people in videos or images. The API compares provided reference images against the media being analyzed and tags any detected matches.

Prerequisites

  • You’re familiar with the concepts described on the Platform overview page.
  • You have created a memories.ai API key.
  • Reference images should be clear and high-quality to maximize accuracy.
  • A maximum of 5 reference images can be provided per request.

Host URL

  • https://security.memories.ai

Usage

Human re-identification is not a standalone endpoint. Instead, it is integrated as part of the Video Caption and Image Caption APIs.
You add a persons parameter to the request body with details of each individual you want to track.


Request Example (Video ReID with URL Upload)

import requests, json

url = "https://security.memories.ai/v1/understand/upload"
headers = {"Authorization": "<API_KEY>"}

json_body = {
"video_url": "https://example.com/test_video.mp4",
"user_prompt": "Summarize the video and identify known persons.",
"system_prompt": "You are a video understanding system that can detect and identify people.",
"callback": "https://yourserver.com/callback",
"persons": [
{"name": "Alice", "url": "https://example.com/alice.jpg"},
{"name": "Bob", "url": "https://example.com/bob.jpg"}
]
}

response = requests.post(url, headers=headers, json=json_body)
print(response.json())

Request Example (Image ReID with File Upload)

import requests, json

url = "https://security.memories.ai/v1/understand/uploadImg"
headers = {"Authorization": "<API_KEY>"}

data = {
"user_prompt": "Identify if Alice appears in this image.",
"system_prompt": "You are an image analysis system with human re-identification capabilities.",
"thinking": False
}

files = [
("req", ("req.json", json.dumps(data), "application/json")),
("file", ("test_image.png", open("test_image.png", "rb"), "image/png")),
("file", ("alice.png", open("alice.png", "rb"), "image/png"))
]

response = requests.post(url, files=files, headers=headers)
print(response.json())

Request Body (ReID Parameter)

persons: 
- name: "Alice"
url: "https://example.com/alice.jpg"
- name: "Bob"
url: "https://example.com/bob.jpg"

Request Parameters

NameLocationTypeRequiredDescription
personsbodyarrayNoList of person descriptors (name + reference image URL or file)
» namebodystringYesPerson’s name or identifier
» urlbodystringNoReference image URL (if file not uploaded)
filebodybinaryNoReference image file (if URL not provided)

Callback Notification Payload

If persons are provided, the result will indicate whether those individuals were detected.

{
"status": 0,
"task_id": "a1b2c3d4e5",
"data": {
"text": "Bob and Alice are both present in the video. Alice enters first, followed by Bob.",
"token": {
"input": 210,
"output": 92,
"total": 302
}
}
}

Response Structure

NameTypeRequiredDescription
statusintYes0 = success, -1 = failure
task_idstringYesUnique task identifier
dataobjectYesResponse data
» textstringYesGenerated caption including detected person matches
» tokenobjectYesToken usage details

Note: Human ReID is always used in conjunction with Video or Image Caption APIs. It cannot be called independently.