GithubHelp home page GithubHelp logo

ekapujiw2002 / fbrecog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samj1912/fbrecog

0.0 2.0 0.0 4 KB

An unofficial python wrapper for the Facebook face recognition endpoint

Python 100.00%

fbrecog's Introduction

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.

  1. Call the recognize method with the following parameters.
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))

##Please star this repo if it helped :)

star

fbrecog's People

Contributors

samj1912 avatar prateekraisinghani avatar

Watchers

James Cloos avatar Eka Puji Widiyanto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.