yxlijun / DSFD.pytorch

DSFD implement with pytorch
167 stars 58 forks source link

result on widerface val #4

Closed yja1 closed 5 years ago

yja1 commented 5 years ago

I test your model on widerface val data. only 0.9 0.91 0.867.

I think maybe something different on images detect 0 face.
I just add wider_test.py line 233 if dets == []: fout.write('0\n')

yja1 commented 5 years ago

and there is another error training:

terminate called after throwing an instance of 'thrust::system::system_error' what(): function_attributes(): after cudaFuncGetAttributes: an illegal memory access was encountered Aborted (core dumped)

yxlijun commented 5 years ago

what is your pytorch version,

I test your model on widerface val data. only 0.9 0.91 0.867.

I think maybe something different on images detect 0 face. I just add wider_test.py line 233 if dets == []: fout.write('0\n')

我用中文吧,在我这测试widerface val 就是我readme那么多啊,你的怎么这么低,是否减小了图片大小

yxlijun commented 5 years ago

and there is another error training:

terminate called after throwing an instance of 'thrust::system::system_error' what(): function_attributes(): after cudaFuncGetAttributes: an illegal memory access was encountered Aborted (core dumped)

你的pytorch 版本是啥,你是否使用了多GPU训练

yja1 commented 5 years ago

1、pytorch version '0.3.0.post4' 我直接跑的你的代码和模型, python wider_test.py 会报错1)path = os.path.join(save_path, event[0][0].encode('utf-8')) 所以我把代码里的encode('utf-8')都去掉就可以了 2)然后执行到图0_Parade_marchingband_1_356.jpg的时候没有检测到任何人脸,就会报错。 dets = dets[0:750, :] UnboundLocalError: local variable 'dets' referenced before assignment 所以才加了fout.write('0\n') 不知道是加这个导致的么?

2)CUDA_VISIBLE_DEVICES= 1 python train.py --batch_size 4 --lr 5e-4 我是这么执行的。这个system_error时有时无的

yangcheng001 commented 5 years ago

我遇到了同样的问题,没有检测到人脸的时候会报错,请问题主后面找到精度低的原因了吗

lwzeng commented 5 years ago

I meet the same problem,and I modify the ‘bbox_vote()’ function to solve it. and I train a vgg16 base model, get 0.945,0.940,0.891(Easy, Medium, hard), the code as follows: def bbox_vote(det): order = det[:, 4].ravel().argsort()[::-1] det = det[order, :] if det.shape[0] == 1: return det flag = 0 while det.shape[0] > 0:

IOU

    area = (det[:, 2] - det[:, 0] + 1) * (det[:, 3] - det[:, 1] + 1)
    xx1 = np.maximum(det[0, 0], det[:, 0])
    yy1 = np.maximum(det[0, 1], det[:, 1])
    xx2 = np.minimum(det[0, 2], det[:, 2])
    yy2 = np.minimum(det[0, 3], det[:, 3])
    w = np.maximum(0.0, xx2 - xx1 + 1)
    h = np.maximum(0.0, yy2 - yy1 + 1)
    inter = w * h
    o = inter / (area[0] + area[:] - inter)

    # get needed merge det and delete these det
    merge_index = np.where(o >= 0.3)[0]
    det_accu = det[merge_index, :]
    det = np.delete(det, merge_index, 0)

    if merge_index.shape[0] <= 1:
        continue
    flag = 1
    det_accu[:, 0:4] = det_accu[:, 0:4] * np.tile(det_accu[:, -1:], (1, 4))
    max_score = np.max(det_accu[:, 4])
    det_accu_sum = np.zeros((1, 5))
    det_accu_sum[:, 0:4] = np.sum(
        det_accu[:, 0:4], axis=0) / np.sum(det_accu[:, -1:])
    det_accu_sum[:, 4] = max_score
    try:
        dets = np.row_stack((dets, det_accu_sum))
    except:
        dets = det_accu_sum
if flag == 1:
    dets = dets[0:750, :]
else:
    dets = np.array([[0,0,0,0,0]])
    print("can not find any face...........")
return dets
luyao777 commented 5 years ago

Is matlab tools that you use to test? I use matlab to plot figure but got bad curves...Is there any test steps to follow?