用户在 OpenMV H7 Plus 上运行基于 Edge Impulse 的图像分类示例代码时,出现 AttributeError:'Model' object has no attribute 'classify' 错误。该错误发生在调用 net.classify() 方法时。
for obj in net.classify(img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
img.draw_rectangle(obj.rect())
# This combines the labels and confidence values into a list of tuples
predictions_list = list(zip(labels, obj.output()))注释中提到“5.18加载人脸识别haar算子降低识别率”,说明当前流程是先做人脸检测(Haar),再对整图或 ROI 执行分类;但报错发生在 classify 调用阶段,与 Haar 无关。
net在新版本固件中早已弃用,现已更改为使用ml模块:ml — 机器学习 — MicroPython 1.22 文档