Face recognition via Search4Faces API
Project description
A simple library with async capabilities to interact with Search4Faces API
Usage
With SearchClient you can easily find social media profiles with similar faces. It is a great tool for finding duplicates, finding people, and more.
Documentation
Official docs can be found on the API's webpage
Installation
pip install Search4Faces
Requirements
Python 3.9+httpxpydantic
Features
Async capabilitiesException handlingPydantic return modelLightWeight
Examples
from Search4Faces import (
SearchClient,
SearchAPIError,
MatchedPerson,
sources,
)
client = SearchClient(
token='your-token',
no_check=False, # if you want to disable token check
)
# you can use photo's url - client will fetch the image for you
photo_url = 'https://imgur.com/XYZ.jpg'
response: list[MatchedPerson] = client.find_similar(
photo_url,
source=sources.VK_OK_NEW_AVATAR, # you can specify the image database to search in
show_hidden=True, # or define if you want hidden profiles to show up
results=25, # and choose how many results you want back (max 500)
)
# you can also provide a file / io.BytesIO object
response: list[MatchedPerson] = client.find_similar(
open('photo.jpg', 'rb'),
)
# you can do some exception handling
try:
response: list[MatchedPerson] = client.find_similar(photo_url)
except SearchAPIError as exc:
print(exc)
# you can use some async methods
await client.find_similar_async(photo_url)
Developed by Nikita Minaev (c) 2023
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Search4Faces-1.0.2.tar.gz.
File metadata
- Download URL: Search4Faces-1.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0db181554b27b0d434657c0f6dac48b2a3f9bf9ebbe56bcad721e7189f81b59
|
|
| MD5 |
b24516ae53dcf6d292eb10eb30966f80
|
|
| BLAKE2b-256 |
f59cb25a9b49fd3aa8263c3b949db3206d0df3b1d9c3cb8eaf1afbc61203894b
|
File details
Details for the file Search4Faces-1.0.2-py3-none-any.whl.
File metadata
- Download URL: Search4Faces-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5799e5cf2c2c3966bc996587cdff8e4519b66b2bed953de0499f0f25de7fd59c
|
|
| MD5 |
cd9373fc3cdbb28246f917534ae12956
|
|
| BLAKE2b-256 |
92f0a10bdfa1d4c912d0dfc991f0ba52a010953e388afbf9752237791edfc74b
|