1

我正在玩 YOLO 暗流(https://github.com/thtrieu/darkflow),我想知道如何更改预测对象的边界框厚度。

我使用以下命令来测试视频

flow --model cfg/yolo-new.cfg --load bin/yolo-new.weights --demo videofile.avi

实际上边界框太厚了。当图像上有很多对象时,我只看到边界框而没有对象。所以我想知道如何使盒子更薄,例如只有 1 或 2 个像素厚。

谢谢 :)

4

1 回答 1

2

编辑

对于 darflow:更改 yolo 和 yolo2 文件 predict.py 中的以下行

cv2.rectangle(imgcv,(left, top), (right, bot),self.meta['colors'][max_indx], thick)

cv2.rectangle(imgcv,(left, top), (right, bot),self.meta['colors'][max_indx], 1)

对于暗网:您必须手动更改盒子的厚度。因此,在 image.c 文件中搜索以下行

cvRectangle(show_img, pt1, pt2, color, width, 8, 0);

width并用像素值更改第 5 个参数

例如,如果你想要 1px 的盒子,那么

cvRectangle(show_img, pt1, pt2, color, 1, 8, 0);
于 2018-03-19T15:03:13.757 回答