Answer the question
In order to leave comments, you need to log in
python imageAi code not working?
I have python 3.7.0.
I use imageAI for object recognition.
The code:
import imageai
from imageai.Detection import ObjectDetection
import os
exec_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(
exec_path, "D:/MyProjects/Python/SearchObject/ObjShot/resnet50_coco_best_v2.0.1.h5/")
)
detector.loadModel()
list = detector.detectObjectsFromImage(
input_image=os.path.join(exec_path, "objects.jpg"),
output_image_path=os.path.join(exec_path, "new_objects.jpg"),
minimum_percentage_probability=90,
display_percentage_probability=True,
display_object_name=False
)
RuntimeError: `get_session` is not available when using TensorFlow 2.0.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question