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

使用mtcnn_pfld_landmark运行getfeature时报错 #8

Open
sleepy-syr opened this issue Nov 11, 2020 · 2 comments
Open

使用mtcnn_pfld_landmark运行getfeature时报错 #8

sleepy-syr opened this issue Nov 11, 2020 · 2 comments

Comments

@sleepy-syr
Copy link

Run person0, name:baiqianyuanTraceback (most recent call last): File "D:/Project/video_recognition/get_face_feature.py", line 101, in <module> _, face_img = detect_face.detect(srcimg) ###肖像照,图片中有且仅有有一个人脸 File "D:\Project\video_recognition\mtcnn_pfld_landmark.py", line 14, in detect bounding_boxes, landmarks = self.mtcnn.detect(srcimg) ###landmarks: numpy array, n x 10 (x1, x2 ... x5, y1, y2 ..y5) File "D:\Project\video_recognition\pfld_mtcnn\detector.py", line 397, in detect bounding_boxes = np.vstack(bounding_boxes) File "<__array_function__ internals>", line 6, in vstack File "D:\Ksoftware\Anaconda2020.2\envs\Restorch\lib\site-packages\numpy\core\shape_base.py", line 283, in vstack return _nx.concatenate(arrs, 0) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate

@hpc203
Copy link
Owner

hpc203 commented Nov 12, 2020

最后打印的错误:ValueError: need at least one array to concatenate
可以看出是没有检测到图片里的人脸,导致bounding_boxes为空,因此就出错了。这算是程序里不严密的地方,应该要对没检测出人脸这种情况加一个异常保护

@YJYlala
Copy link

YJYlala commented Apr 29, 2022

最后打印的错误:ValueError: need at least one array to concatenate 可以看出是没有检测到图片里的人脸,导致bounding_boxes为空,因此就出错了。这算是程序里不严密的地方,应该要对没检测出人脸这种情况加一个异常保护

应该加一个简单的判断 if bounding_boxes == []: return [],[]

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