我现在就是没写其他代码 然后main.py文件能在IDE正常运行但识别不出我数据集里面框选的对象 就是这个图像显示上没有红色框
看一下你的训练指标和日志


第二个消息很长一串的是日志
# This work is licensed under the MIT license.
# Copyright (c) 2013-2025 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# TensorFlow Lite YOLO V8 Example
#
# This example runs a YOLO V8 person detection model.
#
# NOTE: This exaxmple requires an OpenMV Cam with an NPU like the AE3 or N6 to run real-time.
import csi
import time
import ml
from ml.postprocessing.ultralytics import YoloV8
# Initialize the sensor.
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
# Load YOLO V8 model from ROM FS.
model = ml.Model("/rom/trained.tflite", postprocess=YoloV8(threshold=0.2))
print(model)
# Visualization parameters.
n = len(model.labels)
model_class_colors = [(int(255 * i // n), int(255 * (n - i - 1) // n), 255) for i in range(n)]
clock = time.clock()
while True:
clock.tick()
img = csi0.snapshot()
# boxes is a list of list per class of ((x, y, w, h), score) tuples
boxes = model.predict([img])
# Draw bounding boxes around the detected objects
for i, class_detections in enumerate(boxes):
rects = [r for r, score in class_detections]
labels = [model.labels[i] for j in range(len(rects))]
colors = [model_class_colors[i] for j in range(len(rects))]
ml.utils.draw_predictions(img, rects, labels, colors, format=None)
print(clock.fps(), "fps")
使用此代码尝试,然后romfs中是否正确上传了模型和标签
然后你识别的时候OpenMV的画面是什么样的
我开始在romfs上传了的,那个代码我运行但是依旧没有红色框


画面就是这样的

还有办法解决嘛🫢
你拍数据集的时候分辨率是多少?
是640x480

是640x400不是6
40x480
加数据集后重新训练,具体看我上面的建议
训练集要多少张才合适呀,我原来是刚好100张这样
原来是训练集100张。验证集22张,测试集13张,这个分配有没有问题呀
还有数据集的图片标注我是这样的,没问题吧❓

最起码300多张吧,你的数据集里面的图片太同质化了,模型根本学不到特征。你的数据集中的图片应该包含多种角度,多种光线等,不要一个角度死拍几百张,没有作用的,模型学不到特征
好的我试试