【问题标题】:How can I output a specific images in Deep Learning & Computer Vision如何在深度学习和计算机视觉中输出特定图像
【发布时间】:2021-09-22 06:43:58
【问题描述】:

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

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 的每张图像中具有最佳精度。我怎样才能做到这一点?我认为最后一行是问题所在。

【问题讨论】:

    标签: python deep-learning computer-vision object-detection


    【解决方案1】:

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

    refer

    【讨论】:

      【解决方案2】:

      试试这个:

      # 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)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-04-04
        • 2020-02-01
        • 1970-01-01
        • 2020-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-11
        相关资源
        最近更新 更多