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

libfacedetect_align_module有问题,输出的向量尺寸错误 #22

Open
GrayKeee opened this issue Oct 17, 2022 · 4 comments
Open

libfacedetect_align_module有问题,输出的向量尺寸错误 #22

GrayKeee opened this issue Oct 17, 2022 · 4 comments

Comments

@GrayKeee
Copy link

GrayKeee commented Oct 17, 2022

Traceback (most recent call last):
File "10kinds-light-face-detector-align-recognition/libfacedetect_align_module.py", line 275, in
drawimg, face_rois = libface_detect.detect(srcimg)
File "10kinds-light-face-detector-align-recognition/libfacedetect_align_module.py", line 40, in detect
dets = pb.decode(np.squeeze(loc, axis=0), np.squeeze(conf, axis=0))
File "10kinds-light-face-detector-align-recognition/libfacedetection/priorbox.py", line 72, in decode
self.priors[:, 2:4]*np.exp(loc[:, 2:4]*self.variance).reshape((2,1))
ValueError: operands could not be broadcast together with shapes (4385,0) (2,)

@GrayKeee
Copy link
Author

具体来说就是,loc向量是一个n,2维的,而非如注释里所说,是一个n,4维的向量

@GrayKeee
Copy link
Author

而这也已经是这几个脚本里面报错最不邪乎,最有可能跑起来的一个了

@MachineLearning11
Copy link

而这也已经是这几个脚本里面报错最不邪乎,最有可能跑起来的一个了

请问这个如何修改

@guofenggitlearning
Copy link

guofenggitlearning commented Sep 21, 2023

我做了如下修改,此处不报错,可视化效果正常
修改如下行数:

loc, conf = self.net.forward(self.net.getUnconnectedOutLayersNames())

conf,loc = self.net.forward(self.net.getUnconnectedOutLayersNames())
输出反了

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

3 participants