KA
Size: a a a
KA
KA
ф[
ф[
GF
D
D
KA
EM
import telebot
import cv2
TOKEN = "7447488766:AAGmeo0Ifc27hQHbF3ih1HBdMvXgzWZNiVY"
bot = telebot.TeleBot(token=TOKEN)
@bot.message_handler(content_types=['photo'])
def photo(message):
fileID = message.photo[-1].file_id
file_info = bot.get_file(fileID)
downloaded_file = bot.download_file(file_info.file_path)
with open("image.jpg", 'wb') as new_file:
new_file.write(downloaded_file)
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
img = cv2.imread('image.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
for (x,y,w,h) in faces:
img = cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
cv2.imwrite('user.jpg', img)
bot.polling(none_stop=True)
D
D
T
b
callback_data = "yes {chat.id}"
data = call.data.split(' ')
?KA
callback_data = "yes {chat.id}"
data = call.data.split(' ')
?GF
GF
т
KA