Skip to main content

An unoffcial wrapper for Facebook's recognition endpoint

Project description

# fbrecog
An unofficial python wrapper for the Facebook face recognition endpoint
### fbrecog is a python wrapper that uses Facebook's face recognition to recognize faces in pictures.
## How-To:

1. Install fbrecog from pip
`pip install fbrecog`
2. Now simply import the recognize method from fbrecog module
`from fbrecog import recognize`
3. The recognize method takes 4 input args and returns an array of recognitions.
4. To get the access token simply go to https://developers.facebook.com/tools/explorer and get a user access token with *user_photos*, *publish_actions* and *user_posts* permissions.
5. Get your Facebook cookie and fb_dtsg token as follows:

* Go to your Facebook profile.

* Open chrome dev tools by `Right Click > Inspect`

* Upload any picture. As it gets uploaded monitor the Network tab for 'dpr?' endpoint.

* Click on it. Scroll down to *Request Header*. Copy the entire cookie string.

* Scroll further down to *Form Data*. Copy the value of fb_dtsg parameter.

6. Call the recognize method with the following parameters.

```python

from fbrecog import recognize
path = '1.jpg' #Insert your image file path here
access_token = '#######' #Insert your access token obtained from Graph API explorer here
cookie = '###' #Insert your cookie string here
fb_dtsg = '###' #Insert the fb_dtsg parameter obtained from Form Data here.
print(recognize(path,access_token,cookie,fb_dtsg))
```

Project details


Download files

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

Source Distributions

fbrecog-1.2.tar.gz (2.5 kB view details)

Uploaded Source

fbrecog-0.1.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file fbrecog-1.2.tar.gz.

File metadata

  • Download URL: fbrecog-1.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fbrecog-1.2.tar.gz
Algorithm Hash digest
SHA256 07e4e7deaceb311f0a8e632e48a213c76e86a415b967cd35a26fa3c067337d8c
MD5 9265d51b4f414e05bfa17d835bbf43ac
BLAKE2b-256 d8bf2f5535662e45fb2ee189079e4fb311846f8530875d3567b7d21fbe4a48e8

See more details on using hashes here.

File details

Details for the file fbrecog-0.1.tar.gz.

File metadata

  • Download URL: fbrecog-0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fbrecog-0.1.tar.gz
Algorithm Hash digest
SHA256 e5a2a61e87a6bbffb23cb652704ce2236c997ed46239c382481730eee1c5c828
MD5 da3c8f0861af291a8b2281c8e43bf6c3
BLAKE2b-256 eefde422fef5f33c92409317579b8b440843246b1a8e05e82a18fd1a283fba73

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