【问题标题】:how to change the bounding box color in the video output in yolov3 darknet如何在yolov3暗网中更改视频输出中的边界框颜色
【发布时间】:2020-08-26 18:19:38
【问题描述】:

我已经在我的自定义数据集上训练了 YOLOv3 暗网模型。首先,我在 google colab 中克隆了 https://github.com/kriyeng/darknet/ 存储库,然后在 google colab 中运行整个代码。但我想更改输出视频中边界框的颜色。请建议如何做。提前致谢。

【问题讨论】:

    标签: google-colaboratory colorbox bounding-box yolo darknet


    【解决方案1】:

    这是 C++ 中的一个解决方案,但您也可以将其应用于 python。只需更改标量中的值。在下面的示例中,它设置为红色。

    //Draw a rectangle displaying the bounding box
    rectangle(frame, Point(left, top), Point(right, bottom), Scalar(0, 0, 255));
    
    

    【讨论】:

    • 哟,如何获得标量?
    • 标量默认存在于 OpenCV 中,以允许您传递像素值。如果您使用的是 python,我认为 C++ 和 Python 中的标量类型不一样。您可以执行以下操作 # 创建一个空白的 300x300 黑色图像 image = np.zeros((300, 300, 3), np.uint8) # 用红色填充图像(将每个像素设置为红色 BGR 而不是 RGB) image[:] = (0, 0, 255)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-06
    • 1970-01-01
    • 1970-01-01
    • 2016-05-27
    • 2015-09-03
    • 2018-04-18
    相关资源
    最近更新 更多