Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i detect face in image in face_detect.py? I am a newbie #8

Open
phamkhactu opened this issue Feb 9, 2020 · 0 comments
Open

Comments

@phamkhactu
Copy link

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'

Thanks for your help!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant