繁体   English   中英

如何在深度学习和计算机视觉中输出特定图像

[英]How can I output a specific images in Deep Learning & Computer Vision

我有以下几行代码用于车辆识别:

import glob
import imageio
import keras
import tensorflow
from imageai.Detection import ObjectDetection

detector = ObjectDetection()

model_path = 'C:/Users/yolo/models/yolo.h5'
input_path = 'C:/Users/yolo/input'
output_path = 'C:/Users/yolo/output'

detector.setModelTypeAsYOLOv3()
detector.setModelPath(model_path)
detector.loadModel()
detection = detector.detectObjectsFromImage(input_image = input_path, input_type = "stream", output_image_path = output_path)

model_path我有yolov3模型,在input_path我有一些带有汽车、人、自行车等的jpg图像……而output_path是一个空文件夹,我想用汽车提取的图像填充它,该图像在每个图像中都具有最佳精度input_path 我怎样才能做到这一点? 我认为最后一行是问题所在。

名称输出图像 output_path=os.path.join(output_path , name+".jpg")

参考

试试这个:

# This line will make other objects unconsierable
custom_objects = detector.CustomObjects(car=True)
# Here you will pass your image and  
detections = detector.detectCustomObjectsFromImage(custom_objects=custom_objects, input_image=imagpe_path, output_image_path=output_image_path, minimum_percentage_probability=min_prob_you_want)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM