Skip to main content

Build

Rekognition Migration

by sightradar-connect

Migrate face recognition code from AWS Rekognition to the SightRadar API. Use when the user wants an AWS Rekognition alternative, wants to cut Rekognition face search costs, or needs to port IndexFaces, SearchFacesByImage, SearchFaces, CompareFaces, DetectFaces, CreateCollection, DeleteFaces or DeleteCollection calls (boto3, AWS SDK for JavaScript, or CLI) to SightRadar, re-index a face collection, or recalibrate similarity thresholds.

  • New
  • v1.0.0
  • Reviewed Dec 5
  • No reviews yet

Capabilities

  • Route mapping

    Base URL https://api.sightradar.com

  • Runbook

    Work in this order and keep Rekognition running until the last step

  • Rules for the agent

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.0

Migrating from AWS Rekognition to SightRadar

SightRadar covers the face collection part of Rekognition: index, search, compare, detect and delete. It does not do labels, text, moderation, celebrity recognition, video analysis, face attributes (age, emotion) or Face Liveness. If the user's code uses those, keep Rekognition for them and say so up front.

Route mapping

Rekognition SightRadar
CreateCollection POST /v1/collections {"collection_id": "..."} (also created on first index)
ListCollections / DescribeCollection GET /v1/collections / GET /v1/collections/{id}
DeleteCollection DELETE /v1/collections/{id} (soft by default; ?immediate=true to erase now)
IndexFaces POST /v1/collections/{id}/index
IndexFaces with MaxFaces=1 (a user's reference face) POST /v1/collections/{id}/selfies
SearchFacesByImage POST /v1/collections/{id}/search
SearchFaces (by FaceId) POST /v1/collections/{id}/search-by-id
CompareFaces POST /v1/compare
DetectFaces POST /v1/detect
DeleteFaces DELETE /v1/collections/{id}/photos/{photoId} (per photo, not per face)
DeleteUser DELETE /v1/collections/{id}/users/{userId}

Base URL https://api.sightradar.com. Spec: https://api.sightradar.com/openapi.json

What changes in the code

  • Auth. One header, Authorization: Bearer $SIGHTRADAR_API_KEY. No SigV4, IAM roles or regions. The boto3 client cannot be pointed at SightRadar with endpoint_url; replace the calls with the SDK (pip install sightradar, npm install sightradar) or plain HTTP.
  • Images. Image.Bytes becomes a multipart file upload. Image.S3Object becomes a URL the API can fetch: generate a presigned S3 URL.
  • Scores. Similarity is cosine similarity from 0 to 1, not 0 to 100. FaceMatchThreshold=80 does not become 0.80; see the threshold step below.
  • Results are photos, not faces. Search returns matches[{photo_id, score}], one row per photo. ExternalImageId becomes photoId. FaceId becomes point_id.
  • Bounding boxes stay ratios of the image size: left, top, width, height in lower case.
  • Deletes work per photo, selfie, user or collection. There is no delete of a single face inside a group photo.
  • Billing is per photo, not per face or per API call: 93 credits real-time, 62 in batch and for search by id (1 credit = $0.00001). Compare is 93 per image.

Before and after

python
# Before: boto3
rek = boto3.client("rekognition")
rek.index_faces(CollectionId="event-2026", ExternalImageId="img-42",
                Image={"S3Object": {"Bucket": "photos", "Name": "img-42.jpg"}})
res = rek.search_faces_by_image(CollectionId="event-2026", FaceMatchThreshold=80, MaxFaces=50,
                                Image={"Bytes": selfie_bytes})
photo_ids = {m["Face"]["ExternalImageId"] for m in res["FaceMatches"]}
python
# After: pip install sightradar
from sightradar import SightRadar
sr = SightRadar()                                   # reads SIGHTRADAR_API_KEY
url = s3.generate_presigned_url("get_object", Params={"Bucket": "photos", "Key": "img-42.jpg"}, ExpiresIn=3600)
sr.index("event-2026", url=url, photo_id="img-42")
res = sr.search("event-2026", file="selfie.jpg", limit=50)
photo_ids = [m.photo_id for m in res.matches]       # already one entry per photo, ranked

Runbook

Work in this order and keep Rekognition running until the last step.

  1. Inventory. Search the codebase for rekognition, index_faces, search_faces, compare_faces, detect_faces, IndexFacesCommand and similar. List each call site, what it feeds, and any Rekognition feature SightRadar lacks.
  2. Smoke test. With the user's key, index one photo into a scratch collection and search it. This proves the key, the network path and image access.
  3. Port behind a switch. Put the face calls behind one interface with two implementations, chosen by a config flag. Do not delete the Rekognition code yet.
  4. Re-index from the source images. This step cannot be skipped: faceprints only work with the model that made them, so nothing can be exported from Rekognition and imported. Use the batch route for large sets (62 credits per photo, 1,000 URLs per call; see the face-batch-indexing skill). Tell the user the photo count and the cost, and get a yes before starting.
  5. Compare results side by side. Run the same searches on both systems and compare the ranked photo ids, not the raw scores.
  6. Recalibrate the threshold. Score a few hundred known same-person and different-person pairs from the user's data on SightRadar and set the cut-off where they separate. Never reuse the Rekognition number.
  7. Switch reads, keep the old collection for a rollback window, then delete it.

Rules for the agent

  • Refer to the key only as $SIGHTRADAR_API_KEY. Never print or commit it.
  • Do not run the re-index or delete the Rekognition collection without the user's explicit go-ahead: the first costs money, the second cannot be undone.
  • Do not promise identical results. A different model ranks borderline faces differently; step 5 is how the user sees the difference.

Migration guide: https://sightradar.com/docs/guides/migrate-from-rekognition and full docs at https://sightradar.com/llms.txt

Examples

Prompt

I want to migrate my AWS Rekognition code that indexes faces from S3 images to SightRadar. How do I do that?

Output

To migrate indexing faces from AWS Rekognition to SightRadar, replace the Rekognition boto3 call with SightRadar's SDK. Generate a presigned S3 URL for your image, then call sr.index(collection_id, url=presigned_url, photo_id=external_image_id). For example, instead of rek.index_faces with Image.S3Object, use SightRadar's index method with the presigned URL and photo ID. This removes the need for AWS SigV4 auth and uses SightRadar's simpler Bearer token authentication.

Prompt

How can I convert my Rekognition search_faces_by_image call to use SightRadar's API instead?

Output

Replace the Rekognition search_faces_by_image call with SightRadar's search method. Upload the image bytes as a multipart file parameter to POST /v1/collections/{id}/search via the SDK. For example, sr.search(collection_id, file='selfie.jpg', limit=50) returns matches with photo_id and cosine similarity scores from 0 to 1. Adjust your threshold accordingly (e.g., 0.8 instead of 80). This call returns photos, not faces, so handle results by photo_id.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Frequently asked questions about rekognition-migration

What does the rekognition-migration skill do?

Migrate face recognition code from AWS Rekognition to the SightRadar API. Use when the user wants an AWS Rekognition alternative, wants to cut Rekognition face search costs, or needs to port IndexFaces, SearchFacesByImage, SearchFaces, CompareFaces, DetectFaces, CreateCollection, DeleteFaces or DeleteCollection calls (boto3, AWS SDK for JavaScript, or CLI) to SightRadar, re-index a face collection, or recalibrate similarity thresholds. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the rekognition-migration skill?

Run `npx @skills-hub-ai/cli install rekognition-migration` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/rekognition-migration/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does rekognition-migration work with?

rekognition-migration runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the rekognition-migration skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use rekognition-migration after installing it?

In Claude Code, type `/rekognition-migration` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the rekognition-migration skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/rekognition-migration)](https://skills-hub.ai/skills/rekognition-migration)
HTML
<a href="https://skills-hub.ai/skills/rekognition-migration"><img src="https://skills-hub.ai/api/badges/skill/rekognition-migration" alt="Install on Skills Hub"></a>

More options in the badge docs.