kuaikuaikim / dface

Deep learning face detection and recognition, implemented by pytorch. (pytorch实现的人脸检测和人脸识别)
http://dface.tech
Apache License 2.0
1.24k stars 348 forks source link

Error in gen_Onet_train_data.py #10

Closed macsermkiat closed 6 years ago

macsermkiat commented 6 years ago

It gave error from negative dimension, I try to find the value and it's -1, not sure where it came from

~/DFace/dface/core/detect.py in detect_rnet(self, im, dets) 389 for i in range(num_boxes): --> 390 tmp = np.zeros((tmph[i], tmpw[i], 3), dtype=np.uint8) 391 tmp[dy[i]:edy[i]+1, dx[i]:edx[i]+1, :] = im[y[i]:ey[i]+1, x[i]:ex[i]+1, :] 392 crop_im = cv2.resize(tmp, (24, 24))

ValueError: negative dimensions are not allowed

kuaikuaikim commented 6 years ago

@macsermkiat which value is -1, can you show me more details, thanks.

kimimatias commented 6 years ago

Hello. I got the same error. It came from 390 line of /DFace/dface/core/detect.py. Namely after the first hundred processed images in tmp = np.zeros(tmph[i], tmpw[i], 3), dtype=np.uint8) tmph[i] == -4 and tmpw[i] == -4 when i == 457

kuaikuaikim commented 6 years ago

@kimimatias which version of your python

macsermkiat commented 6 years ago

@kuaikuaikim I'm using Python 2.7 It's as @kimimatias wrote. There're some of tmph[i] < 0 There are also sometimes tmph[i] == 0 too, that also caused error.

kuaikuaikim commented 6 years ago

@macsermkiat @kimimatias Maybe some bias sample make this problem, try filter this sample image of negative prediction.

kimimatias commented 6 years ago

@kuaikuaikim I'm using Python 3.5