centernet-tf2 icon indicating copy to clipboard operation
centernet-tf2 copied to clipboard

训练的模型得不到结果,没有框,什么原因?

Open GraceKafuu opened this issue 3 years ago • 11 comments

Loss正常下降,所有的看起来都很正常,就是用模型测试图片的时候没有框显示,这是什么原因呢?

GraceKafuu avatar Aug 25 '21 15:08 GraceKafuu

2007_train有目标信息你?

bubbliiiing avatar Aug 28 '21 12:08 bubbliiiing

Loss正常下降,所有的看起来都很正常,就是用模型测试图片的时候没有框显示,这是什么原因呢?

dataloader这块感觉作者还没有写全,载入box的时候很多问题

tonylin52 avatar Dec 07 '21 03:12 tonylin52

Loss正常下降,所有的看起来都很正常,就是用模型测试图片的时候没有框显示,这是什么原因呢?

dataloader这块感觉作者还没有写全,载入box的时候很多问题

一般来讲是没有目标信息…你可以直接提出对应的问题,我核查后存在会修改的

bubbliiiing avatar Dec 07 '21 15:12 bubbliiiing

Loss正常下降,所有的看起来都很正常,就是用模型测试图片的时候没有框显示,这是什么原因呢?

dataloader这块感觉作者还没有写全,载入box的时候很多问题

一般来讲是没有目标信息…你可以直接提出对应的问题,我核查后存在会修改的

按照正常voc格式输入后 dataloader载入的box格式不对,目前拿到的box都是[] 现在dataloader载入的是自己组建的imageset txt格式。 并且现在的dataloader里面数据增强 没有对box进行一起变换

tonylin52 avatar Dec 08 '21 07:12 tonylin52

    #---------------------------------#
    #   对真实框进行调整
    #---------------------------------#
    if len(box)>0:
        np.random.shuffle(box)
        box[:, [0,2]] = box[:, [0,2]]*nw/iw + dx
        box[:, [1,3]] = box[:, [1,3]]*nh/ih + dy
        if flip: box[:, [0,2]] = w - box[:, [2,0]]
        box[:, 0:2][box[:, 0:2]<0] = 0
        box[:, 2][box[:, 2]>w] = w
        box[:, 3][box[:, 3]>h] = h
        box_w = box[:, 2] - box[:, 0]
        box_h = box[:, 3] - box[:, 1]
        box = box[np.logical_and(box_w>1, box_h>1)] 

这是对box变换的代码

bubbliiiing avatar Dec 08 '21 14:12 bubbliiiing

你2007_train.txt也许就没有目标信息

bubbliiiing avatar Dec 08 '21 14:12 bubbliiiing

谢谢!! 我建议在voc_annotation.py中直接生成目标信息

tonylin52 avatar Dec 09 '21 02:12 tonylin52

    #---------------------------------#
    #   对真实框进行调整
    #---------------------------------#
    if len(box)>0:
        np.random.shuffle(box)
        box[:, [0,2]] = box[:, [0,2]]*nw/iw + dx
        box[:, [1,3]] = box[:, [1,3]]*nh/ih + dy
        if flip: box[:, [0,2]] = w - box[:, [2,0]]
        box[:, 0:2][box[:, 0:2]<0] = 0
        box[:, 2][box[:, 2]>w] = w
        box[:, 3][box[:, 3]>h] = h
        box_w = box[:, 2] - box[:, 0]
        box_h = box[:, 3] - box[:, 1]
        box = box[np.logical_and(box_w>1, box_h>1)] 

这是对box变换的代码

数据增强有flip 但是好像没有对应的box变换

tonylin52 avatar Dec 09 '21 02:12 tonylin52

1、有生成啊。 2、if flip: box[:, [0,2]] = w - box[:, [2,0]]

bubbliiiing avatar Dec 12 '21 16:12 bubbliiiing

1、有生成啊。 2、if flip: box[:, [0,2]] = w - box[:, [2,0]]

看到了 谢谢 我之前选的模式一直是1

tonylin52 avatar Dec 13 '21 02:12 tonylin52

好的加油

bubbliiiing avatar Dec 15 '21 15:12 bubbliiiing