Close Menu
Techs Slash

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Why SaaS Growth Through Search Requires More Than Content Volume — And Why Seo For Saas Has to Get Smarter

    April 27, 2026

    Keansburg Facility Maintenance by Tech Services of NJ

    April 27, 2026

    Container Office for Sale and 40ft High Cube Container: What You Need to Knaow Before You Buy

    April 24, 2026
    Facebook X (Twitter) Instagram
    Techs Slash
    • Home
    • News
      • Tech
      • Crypto News
      • Cryptocurrency
    • Entertainment
      • Actors
      • ANGEL NUMBER
      • Baby Names
      • Beauty
      • beauty-fashion
      • facebook Bio
      • Fitness
      • Dubai Tour
    • Business
      • Business Names
    • Review
      • Software
      • Smartphones & Apps
    • CONTRIBUTION
    Facebook X (Twitter) Instagram
    Techs Slash
    Home»python»Python 3 Facial Recognition Script to Compare Two People Faces Using Face++ Library in Command Line
    python

    Python 3 Facial Recognition Script to Compare Two People Faces Using Face++ Library in Command Line

    Ranveer KumarBy Ranveer KumarOctober 20, 2022No Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email

    Warning: Trying to access array offset on value of type bool in /home/cadesimu/techsslash.com/wp-content/themes/smart-mag/partials/single/featured.php on line 78
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Python 3 Facial Recognition Script to Compare Two People Faces Using Face++ Library in Command Line

    # Python program for face
    # comparison
    
    
    from __future__ import print_function, unicode_literals
    from facepplib import FacePP, exceptions
    import emoji
    
    
    # define global variables
    face_detection = ""
    faceset_initialize = ""
    face_search = ""
    face_landmarks = ""
    dense_facial_landmarks = ""
    face_attributes = ""
    beauty_score_and_emotion_recognition = ""
    
    # define face comparing function
    def face_comparing(app, Image1, Image2):
    
      print()
      print('-'*30)
      print('Comparing Photographs......')
      print('-'*30)
    
    
      cmp_ = app.compare.get(image_url1 = Image1,
                image_url2 = Image2)
    
      print('Photo1', '=', cmp_.image1)
      print('Photo2', '=', cmp_.image2)
    
      # Comparing Photos
      if cmp_.confidence > 70:
        print('Both photographs are of same person......')
      else:
        print('Both photographs are of two different persons......')
    
    
    # Driver Code
    if __name__ == '__main__':
    
      # api details
      api_key ='xQLsTmMyqp1L2MIt7M3l0h-cQiy0Dwhl'
      api_secret ='TyBSGw8NBEP9Tbhv_JbQM18mIlorY6-D'
    
      try:
    
        # create a logo of app by using iteration,
        # unicode and emoji module-------------
        for i in range(1,6):
    
          for j in range(6,-i):
            print(" " , end = " ")
    
          for j in range(1,i):
            print('\U0001F600', end =" ")
    
          for j in range(i,0,-1):
            print('\U0001F6A3', end= " ")
    
          for j in range(i,1,-2):
            print('\U0001F62B', end= " ")
    
          print()
    
        print()
    
        #print name of the app--------
        print("\t\t\t"+"Photo Comparing App\n")
    
        for i in range(1,6):
    
          for j in range(6,-i):
            print(" " , end = " ")
    
          for j in range(1,i):
            print(emoji.emojize(":princess:"), end =" ")
    
          for j in range(i,0,-1):
            print('\U0001F610', end= " ")
    
          for j in range(i,1,-2):
            print(emoji.emojize(":baby:"), end= " ")
    
          print()
    
        # call api
        app_ = FacePP(api_key = api_key,
              api_secret = api_secret)
        funcs = [
          face_detection,
          face_comparing_localphoto,
          face_comparing_websitephoto,
          faceset_initialize,
          face_search,
          face_landmarks,
          dense_facial_landmarks,
          face_attributes,
          beauty_score_and_emotion_recognition
        ]
    
        # Pair 1
        image1 = 'Image 1 link'
        image2 = 'Image 2 link'
        face_comparing(app_, image1, image2)
    
        # Pair2
        image1 = 'Image 1 link'
        image2 = 'Image 2 link'
        face_comparing(app_, image1, image2)
    
      except exceptions.BaseFacePPError as e:
        print('Error:', e)
    
    
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Ranveer Kumar
    • Website

    Related Posts

    JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    December 18, 2023

    Why does math.log result in ValueError: math domain error?

    December 17, 2023

    “inconsistent use of tabs and spaces in indentation” [duplicate]

    December 16, 2023
    Leave A Reply Cancel Reply

    Top Posts

    Sapne Me Nahane Ka Matlab

    March 18, 2024

    Sapne Me Nagn Stri Dekhna

    March 18, 2024

    Self Reliance: Release Date, Cast, Plot, Trailer, and More Information

    March 18, 2024

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    ABOUT TECHSSLASH

    Welcome to Techsslash! We're dedicated to providing you with the best of technology, finance, gaming, entertainment, lifestyle, health, and fitness news, all delivered with dependability.

    Our passion for tech and daily news drives us to create a booming online website where you can stay informed and entertained.

    Enjoy our content as much as we enjoy offering it to you

    Most Popular

    Sapne Me Nahane Ka Matlab

    March 18, 2024

    Sapne Me Nagn Stri Dekhna

    March 18, 2024

    Self Reliance: Release Date, Cast, Plot, Trailer, and More Information

    March 18, 2024
    CONTACT DETAILS

    Phone: +92-302-743-9438
    Email: contact@serpinsight.com

    Our Recommendation

    Here are some helpfull links for our user. hopefully you liked it.

    kakekmerah4d

    Techs Slash
    Facebook X (Twitter) Instagram Pinterest
    • Home
    • About us
    • contact us
    • Affiliate Disclosure
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • Write for us
    • Daman Game
    © 2026 Techsslash. All Rights Reserved

    Type above and press Enter to search. Press Esc to cancel.