face_recognition icon indicating copy to clipboard operation
face_recognition copied to clipboard

Don't have twitter atm sorry, I'll post my code and see if it can help you? I'm using psycopg2 as well. This isn't a final product but you can see if it works for you:

Open MuhammadNumanmn opened this issue 5 years ago • 0 comments

Don't have twitter atm sorry, I'll post my code and see if it can help you? I'm using psycopg2 as well. This isn't a final product but you can see if it works for you:

` image = face_recognition.load_image_file(self.filename) face_encoding = face_recognition.face_encodings(image)[0] #only 1 face expected when entering 'mugshot' face_encoding_string = "("

    for distance in face_encoding:
        face_encoding_string+=str(distance)
        face_encoding_string+=str(",")

    face_encoding_string = face_encoding_string[:-1]
    face_encoding_string += str(")")
    print(face_encoding_string) # demo what a face encoding data looks like in the output
    conn = psycopg2.connect(host="localhost",database="postgres", user="postgres", password="password")
    cur = conn.cursor()
    cur.execute("INSERT INTO wanted (first_name, last_name, face_encoding) VALUES ('"+self.entry_1.get()+"', '"+self.entry_2.get()+"', '"+face_encoding_string+"')");
    conn.commit()
    conn.close()`

Originally posted by @mmelatti in https://github.com/ageitgey/face_recognition/issues/238#issuecomment-375035715

MuhammadNumanmn avatar Jul 26 '21 15:07 MuhammadNumanmn