How to train new fast-rcnn imageset

北战南征 提交于 2019-12-05 15:35:17
  1. it says that there exists boxes[:,2] < boxes[:, 0], boxes[:, 2] is the x-max of bounding box while boxes[:, 0] is x-min. So the problem is related to region proposal. I came across with this problem too. I found that it was causes by overflow. I remember that the dtype for boxes is np.uint8(need to check), if the image is too big, you get this error.
  2. rescale is one solution, however this may influence the performance. You can change the dtype from uint8 to float instead.
  3. As far as I know, there is no need for that.

I'm late to the party, but when I was editing the code this was my yakkity-hack of a solution

        for b in range(len(boxes)):
            if boxes[b][2] < boxes[b][0]:
                boxes[b][0] = 0
        assert (boxes[:, 2] >= boxes[:, 0]).all()

There are smarter ways to do this, as every single grad student seems to point out, but this works fine.

jkjung13

Check out the solution described in the following blog post, Part 4, Issue #4. The solution is to flip the x1 and x2 coordinate values.

https://huangying-zhan.github.io/2016/09/22/detection-faster-rcnn.html

Following is copied from link:

box [:, 0] > box[:, 2]

Solution: add the following code block in imdb.py

def append_flipped_images(self):
num_images = self.num_images
widths = self._get_widths()
for i in xrange(num_images):
    boxes = self.roidb[i]['boxes'].copy()
    oldx1 = boxes[:, 0].copy()
    oldx2 = boxes[:, 2].copy()
    boxes[:, 0] = widths[i] - oldx2
    boxes[:, 2] = widths[i] - oldx1
    for b in range(len(boxes)):
            if boxes[b][2] < boxes[b][0]:
                boxes[b][0]=0
    assert (boxes[:, 2] >= boxes[:, 0]).all()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!