ImageAI实现目标检测

A python library built to empower developers to build applications and systems with self-contained Deep Learning and Computer Vision capabilities using simple and few lines of code. 

https://github.com/OlafenwaMoses/ImageAI

model:https://github.com/OlafenwaMoses/ImageAI/releases

 

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path, "resnet50_coco_best_v2.0.1.h5") )
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path, "image2.jpg"))

for eachObject in detections:
    print(eachObject["name"] + " : " + eachObject["percentage_probability"])

 

ImageAI实现目标检测_第1张图片

ImageAI实现目标检测_第2张图片

你可能感兴趣的:(机器视觉)