telegrambot/index.py

17 lines
778 B
Python
Raw Permalink Normal View History

import requests
from deepface import DeepFace
import os
# url_one="https://gas-kvas.com/grafic/uploads/posts/2023-09/1695805187_gas-kvas-com-p-kartinki-garri-potter-6.jpg"
# url_two="https://frazy.su/wp-content/uploads/2016/07/regnum_picture_1464862366254511_normal.jpg"
current_path = os.path.dirname(os.path.abspath(__file__))
photos_path = os.path.join(current_path,"photos")
# response_one=requests.get(url_one)
# response_two=requests.get(url_two)
photo_1 = os.path.join(photos_path,"photo_one.jpeg")
photo_2 = os.path.join(photos_path,"photo_two.jpeg")
print(photo_1,photo_2)
# with open(photo_1,"wb") as f: f.write(response_one.content)
# with open(photo_2,"wb") as f: f.write(response_two.content)
result = DeepFace.verify("photo_one.jpg","photo_two.jpg")
print(result)