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

运行程序报错statistics.StatisticsError: mean requires at least one data point #6

Open
showfuture opened this issue Nov 19, 2024 · 4 comments

Comments

@showfuture
Copy link

image
你好,请问我在运行程序识别红绿灯图片的时候报错是什么问题导致的呢?

@LIU42
Copy link
Owner

LIU42 commented Nov 19, 2024

哦哦,这是我的问题,我在计算平均用时的时候去掉了一个最大值和一个最小值(考虑到 warm up),如果图片只有一两张会导致空列表,可以将:

return statistics.mean(sorted(execution_times)[1:-1])

改为:

return statistics.mean(execution_times)

这样会直接对所有的推理用时计算均值。

@showfuture
Copy link
Author

result_a205716201934e789d22ae2cced3c2de

处理完的图片是这个样子,是正常的吗?

@LIU42
Copy link
Owner

LIU42 commented Nov 19, 2024

将图像的尺寸调整为640x480再试试呢?看样子红绿灯检测部分应该是正常的,貌似问题出在对红绿灯区域的截取上,YOLO的模型会直接输出边界框的像素坐标,而我目前没有针对不同尺寸的图像作调整,红绿灯区域的截取是在640x480输入图像的前提下进行的。

@showfuture
Copy link
Author

640x480 是正常的,谢谢大佬

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

2 participants