sightradar-rekognition-shim
A drop-in shim that lets code written against AWS Rekognition (via boto3)
run against SightRadar with a ~2-line change.
SightRadar is a Rekognition-compatible face-recognition API. This package proves
"drop-in": the client mirrors Rekognition's method names and argument shapes, and
translates responses back into Rekognition-shaped dicts (FaceRecords,
FaceMatches, Similarity, BoundingBox, …). Zero dependencies — pure stdlib.
Install
pip install sightradar-rekognition-shim
The 2-line change
Before — AWS Rekognition:
import boto3
rek = boto3.client("rekognition", region_name="us-east-1")
rek.create_collection(CollectionId="event-2026")
rek.index_faces(
CollectionId="event-2026",
Image={"S3Object": {"Bucket": "my-bucket", "Name": "guest.jpg"}},
ExternalImageId="guest-1",
)
res = rek.search_faces_by_image(
CollectionId="event-2026",
Image={"Bytes": open("selfie.jpg", "rb").read()},
FaceMatchThreshold=90,
MaxFaces=5,
)
for m in res["FaceMatches"]:
print(m["Face"]["ExternalImageId"], m["Similarity"])
After — SightRadar (only the client line changes):
from sightradar_rekognition_shim import client # 1. swap the import
rek = client(api_key="frs_...") # 2. swap the constructor
rek.create_collection(CollectionId="event-2026")
rek.index_faces(
CollectionId="event-2026",
Image={"URL": "https://cdn.example.com/guest.jpg"}, # URL/GcsKey or Bytes
ExternalImageId="guest-1",
)
res = rek.search_faces_by_image(
CollectionId="event-2026",
Image={"Bytes": open("selfie.jpg", "rb").read()},
FaceMatchThreshold=90,
MaxFaces=5,
)
for m in res["FaceMatches"]:
print(m["Face"]["ExternalImageId"], m["Similarity"])
The rest of your call sites stay the same.
The API key can also come from the SIGHTRADAR_API_KEY environment variable, so
client() with no arguments works too.
Mapped operations
| Rekognition method | SightRadar endpoint |
|---|---|
create_collection |
POST /v1/collections |
delete_collection |
DELETE /v1/collections/{id} (soft by default; Immediate=True / Compliance=True shim kwargs) |
list_collections |
GET /v1/collections |
describe_collection |
GET /v1/collections/{id} |
index_faces |
POST /v1/collections/{id}/index |
search_faces_by_image |
POST /v1/collections/{id}/search |
search_faces (by id) |
POST /v1/collections/{id}/search-by-id |
detect_faces |
POST /v1/detect |
compare_faces |
POST /v1/compare |
Behavioural notes (honest differences)
- Score scale. Rekognition uses
0..100; SightRadar uses cosine similarity0..1. The shim converts both ways automatically: yourFaceMatchThreshold=90becomes0.9, and a returnedSimilarityis scaled back to0..100. - Bounding boxes. SightRadar returns the same ratio convention as Rekognition
(
left/top/width/heightin0..1, top-left origin), soBoundingBoxis populated on everyFaceRecord/FaceDetailwith no extra input. The raw box is also kept underSightRadarBBox. - Image input.
Image={"Bytes": ...}is uploaded as multipart. The shim also accepts the SightRadar-native{"URL": ...}/{"GcsKey": ...}, and maps{"S3Object": {"Bucket","Name"}}to a publichttps://<bucket>.s3.amazonaws.com/<name>URL. compare_facesaccepts URL/GcsKey images (not rawBytes), matching the SightRadar/v1/comparecontract.- Deletion is soft by default. Rekognition's
DeleteCollectionis immediate and final; SightRadar's default is a restorable soft delete with an asynchronous purge (202). PassImmediate=True(orCompliance=Truefor an audited GDPR/BIPA erasure) to match Rekognition's finality. The 202 body is underSightRadarRaw. - Unsupported Rekognition ops (
detect_labels,detect_text,recognize_celebrities, video ops, user-vector ops,delete_faces— use the per-photo delete endpoint instead, …) raise a clearNotImplementedErrornaming the limitation and the SightRadar alternative — they never silently no-op. - Extra data isn't lost. Every response includes a
SightRadarRawkey with the untranslated SightRadar payload.
Errors
All transport/API failures raise SightRadarShimError with .message and
.status_code.
License
MIT — see LICENSE.
Release files for sightradar-rekognition-shim 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sightradar_rekognition_shim-0.3.0.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sightradar_rekognition_shim-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.0 kB
Release files / sightradar_rekognition_shim-0.3.0.tar.gz
| Download URL | sightradar_rekognition_shim-0.3.0.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4465f6c258c138be511a1dca6f51f6b24f923c49dde6b48c23652c9398a04f5
|
|
BLAKE2b-256 checksum How to use checksums |
20df5cc97f729c9a2444de958e2b918c1735615c04baea57aa70bc0acf7d8648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / sightradar_rekognition_shim-0.3.0-py3-none-any.whl
| Download URL | sightradar_rekognition_shim-0.3.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a057f9697da674d3016c2f02802fdb0d634c716698b9c8a02fcacc8f95a5926
|
|
BLAKE2b-256 checksum How to use checksums |
1c8be0ca6312fd15d4755d0e24a6df72205a2888fa3e5572cdba54cec928ad85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|