Skip to main content

Face recognition via Search4Faces API

Project description

Search4FacesAPI

PyPI PyPI

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+
  • httpx
  • pydantic

Features

  • Async capabilities
  • Exception handling
  • Pydantic return model
  • LightWeight

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Search4Faces-1.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

Search4Faces-1.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file Search4Faces-1.0.1.tar.gz.

File metadata

  • Download URL: Search4Faces-1.0.1.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

Hashes for Search4Faces-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e46fc8855973b314d9b0b47a7709f4266ff65f75b20e9cd1a56f768dfa411328
MD5 a9923c7a1a6abaf755756b6bca912af0
BLAKE2b-256 26b8e3ea00f8c2fa1ec3d2a41ab0301d61a62f70861a68003f8464e1ae91f8c0

See more details on using hashes here.

File details

Details for the file Search4Faces-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Search4Faces-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e7018f91d1e70ef5266abaffcec6d95cd99fbd5235aa8effa0a6407842d005a
MD5 19853f76142021d62f4da99aaba38e17
BLAKE2b-256 1b8f06d78a6a553518ca6ceb40d5a34a384d8471dab581e5614810203f6a3b21

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page