faster-mobile-retinaface
faster-mobile-retinaface copied to clipboard
how can i detect face in image in face_detect.py? I am a newbie
here my code
fd = MxnetDetectionModel("weights/16and32", 0,
scale=.4, gpu=-1, margin=0.15)
img = cv2.imread('./images/test.jpg')
copy = np.array(img)
detach = fd.detect(copy)
for res in fd._nms_wrapper(detach):
cv2.rectangle(img, (res[0], res[1]),(res[2], res[3]), (255, 255, 0))
cv2.imshow('face',img)
cv2.waitKey()
and error
inferance: 0.009732400998473167
<generator object BaseDetection.non_maximum_suppression at 0x7f73341e28b8>
Traceback (most recent call last):
File "face_detector.py", line 282, in <module>
for res in fd._nms_wrapper(detach):
File "face_detector.py", line 71, in non_maximum_suppression
x1, y1, x2, y2, scores = dets.T
AttributeError: 'generator' object has no attribute 'T'