通过将图像分割成图块并将图块重建为单个图像来检测高分辨率图像上的对象

发布于 2025-01-12 15:52:32 字数 202 浏览 0 评论 0原文

我的 yolov5 模型是在 416 * 416 图像上训练的。我需要检测大小为 4008 * 2672 的输入图像上的对象。我将图像分割为大小为 416 * 416 的图块并馈送到模型,它可以检测对象,但在拼接预测图像图块以进行重建时原始图像中,我可以看到图块边缘的一些对象被分割,并在一个图块中检测到一半,在另一个图块中检测到另一半,有人可以告诉我如何将这一半检测变成重建中的单个检测。

My yolov5 model was trained on 416 * 416 images. I need to detect objects on my input image of size 4008 * 2672. I split the image into tiles of size 416 * 416 and fed to the model and it can able to detect objects but at the time of stitching the predicted image tiles to reconstruct original image, I could see some objects at the edge of tiles become split and detecting half in one tile and another half in another tile, can someone tell me how to made that half detections into a single detection in the reconstruction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

喜你已久 2025-01-19 15:52:32

在偏移图块分割后运行第二次检测将确保所有先前剪切的对象都位于单个图块中(假设它们小于图块)。也许您可以将两个结果结合起来以获得完整的对象

Running a second detection after offseting the tiles split would ensure that all previously cut objects would be in a single tile (assuming they are smaller than a tile). Maybe you could then combine the two results to get only the full objects

北座城市 2025-01-19 15:52:32

您写了“我需要检测对象”,但没有说明为什么分割图像是您选择的解决方案。我想问一下,有必要分割图像吗?
这是 yolov4 在 (3840,2160,3) 图像上的输出。 yolov4 在内部将图像大小调整为参数指定的大小(YOLO FAMILY ALLOWED IN_DIMS: (320, 320), (416, 416), (512, 512), (608, 608)),这对用户来说应该是透明的。
输入图片此处描述

You wrote "I need to detect objects" but didn't say why splitting the image is the solution you chose. I must ask, is splitting the image necessary?
Here is the output of yolov4 on a (3840,2160,3) image. yolov4 resize the image internally to size specified as an argument (YOLO FAMILY ALLOWED IN_DIMS: (320, 320), (416, 416), (512, 512), (608, 608)), that should be transparent to the user.
enter image description here

百合的盛世恋 2025-01-19 15:52:32

我认为你必须计算对象的并集才能获得边界框,就像你在平铺图像时计算 iou 一样。你尝试过吗?
我也在同一路径中使用图像平铺技术来检测小物体。

I think you have to calculate union of the objects to get bounding boxes as you might calculated iou while tiling the images. Did you try that?
I am also in the same path used image tiling technique for detecting small objects.

清秋悲枫 2025-01-19 15:52:32

我通过编写后处理代码解决了确切的问题,该代码基本上结合了两个检测到的边界框并创建了一个包含其他两个边界框的新框。

https://github.com/ultralytics/yolov5/issues/11821

看看这个GitHub问题

I have solved the exact problem by writing post processing code that basically combines the the two detected bounding boxes and creates a new box that includes the other two.

https://github.com/ultralytics/yolov5/issues/11821

Check out this GitHub issue

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文