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

运行wider_test.py遇到的问题 #10

Open
1529046970 opened this issue Apr 10, 2019 · 6 comments
Open

运行wider_test.py遇到的问题 #10

1529046970 opened this issue Apr 10, 2019 · 6 comments

Comments

@1529046970
Copy link

您好,谢谢您提供的代码!我在测试时遇到问题。detect到第1241张图片后traceback,在调用wider_test.py下的bbox_vote函数时,没有进入while循环(报错:UnboundLocalError:local variable 'dets' referenced before assignment),您可以对我的遇到的错误给一些意见吗?谢谢!

@yxlijun
Copy link
Owner

yxlijun commented Apr 10, 2019

报错的原因是因为没有检测到人脸框,所以会报错,你可以写一个判断机制,如果det.shape[0]==0返回一个一维全是0 的det,比如dets = np.array([0,0,0,0,0])的代码,这样就不会出现dets没有被赋值了

@1529046970
Copy link
Author

非常感谢您的回复!我按照您建议的方法试了一下,在bbox_vote()中加入了判断,发现还是报一样的错,我尝试在while中输出信息,发现在traceback之前,进入了一次while循环。您可以帮我看一下是哪里出了问题吗?再次谢谢您!
IMG_2866

@1529046970
Copy link
Author

我找到问题原因,得到了正确结果!谢谢了!

@Xu-jingjing
Copy link

麻烦问一下,我出现了和你一样的错误,请问你是如何结局的呢,谢谢 @1529046970

@1529046970
Copy link
Author

bbox_vote()中加入了判断,det.shape[0]==1时,就直接返回det

@zhaoxin111
Copy link

bbox_vote()中if merge_index.shape[0] <= 1:可改为<,不然可能会报错

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

4 participants