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

一个小bug #14

Open
honor-007 opened this issue Jul 7, 2023 · 0 comments
Open

一个小bug #14

honor-007 opened this issue Jul 7, 2023 · 0 comments

Comments

@honor-007
Copy link

子豪兄你好,很感谢你无私分享ai干货,我在学习你的代码时发现一个小bug。
在关键点检测-3-YOLOV8关键点检测-预训练模型预测-【c1】YOLOV8预训练模型预测-Python API-图像.ipynb文件中 In[25]中,代码:
# 获取框的预测类别(对于关键点检测,只有一个类别)
bbox_label = results[0].names[0]
results[0].names获取的是coco.yaml文件中所有names的数组形式,所以results[0].names[0]这种取值方式获取到的不是结果类别,而永远是names数组中的第一个对象,也就是person。

我使用以下代码进行了修改:
proto = tf.make_tensor_proto(results[0].boxes.cls)
array = tf.make_ndarray(proto)
bbox_label = results[0].names[array[idx]]
以获取到获取框的预测类别

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