Привет! Я делаю распознавание объектов в python. Вот мой код:
from imageai.Detection import ObjectDetection
detector = ObjectDetection()
model_path = “./models/yolo-tiny.h5”
input_path = “./input/test45.jpg”
output_path = “./output/newimage.jpg”
detector.setModelTypeAsTinyYOLOv3()
detector.setModelPath(model_path)
detector.loadModel()
detection = detector.detectObjectsFromImage(input_image=input_path, output_image_path=output_path)
for eachItem in detection:
print(eachItem , “ : ”, eachItem)
Этот код выдает ошибку:
Traceback (most recent call last):
File “C:\Users\Даниил\PycharmProjects\object_detection\main.py”, line 1, in
from imageai.Detection import ObjectDetection
File “C:\Users\Даниил\PycharmProjects\object_detection\venv\lib\site-packages\imageai\Detection\__init__.py”, line 17, in
from imageai.Detection.YOLOv3.models import yolo_main, tiny_yolo_main
File “C:\Users\Даниил\PycharmProjects\object_detection\venv\lib\site-packages\imageai\Detection\YOLOv3\models.py”, line 8, in
from keras.layers.normalization import BatchNormalization
ImportError: cannot import name ‘BatchNormalization’ from ‘keras.layers.normalization’ (C:\Users\Даниил\PycharmProjects\object_detection\venv\lib\site-packages\keras\layers\normalization\__init__.py)
Помогите решить проблему. Заранее спасибо.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.