from imageai.Detection import ObjectDetection
import os
from tensorflow.keras.layers import BatchNormalization
execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath( os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "4945672649_c4ce544922_b.jpg"), output_image_path=os.path.join(execution_path , "image2new.jpg"), minimum_percentage_probability=30)
Traceback (most recent call last):
File "C:\Users\Gegam\pypy\PYTHOOON\Py.python\999.py", line 1, in <module>
from imageai.Detection import ObjectDetection
File "C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\imageai\Detection\__init__.py", line 17, in <module>
from imageai.Detection.YOLOv3.models import yolo_main, tiny_yolo_main
File "C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\imageai\Detection\YOLOv3\models.py", line 8, in <module>
from keras.layers.normalization import BatchNormalization
ImportError: cannot import name 'BatchNormalization' from 'keras.layers.normalization' (C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\keras\layers\normalization\__init__.py)
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
import telegram
import time
from datetime import datetime, timedelta
browser = webdriver.Chrome()
browser.maximize_window()
browser.get('111111111111111111111')
def Finish():
A = time.strftime('%H:%M', time.localtime())
print(A)
# Парсит имя и счёт
Name = browser.find_element_by_class_name('u-fg').text
Namemassif = Name.split()
Finish = browser.find_element_by_class_name('betCols1').text
Finish_massif=Finish.split()
BOT_TOKEN = '000000000000000'
bot = telegram.Bot(token=BOT_TOKEN)
response = bot.send_message(chat_id=-00000000000, text=A)
while True:
Z4 = browser.find_element_by_class_name('o-tablo-info-list').text
Z4_massif = Z4.split()
while Z4_massif[0] != '2-ой':
time.sleep(1)
browser.refresh()
message_id = response.message_id
bot.edit_message_text(A+ '\n' + Namemassif[0] + ' ' + Namemassif[-1] + '\n' + Finish_massif, chat_id=-1001427028960, message_id=message_id)
browser.find_element_by_xpath('//*[@id="hottest_games"]/div/div[1]/div/div/div[2]/div/ul/li[1]/a').click()
Z5 = browser.find_element_by_class_name('o-tablo-row').text
Z5_massif = Z5.split()
if '2-ой' in Z5_massif:
Rounds = browser.find_element_by_class_name('cyber-stat-table').text
Rounds_massif = Rounds.split()
del Rounds_massif[0:6]
break
else:
pass
else:
pass
break
def index_game_6():
try:
index_3 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/div').text
SS = index_3.split()
if SS[0] == '0' and SS[1] == '0':
time.sleep(3)
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/a').click()
time.sleep(5)
Finish()
else:
pass
except (NoSuchElementException, TimeoutException):
pass
index_game_6()
browser.close()
telegram.error.BadRequest: Message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message