OpenMV N6板子连接上后运行默认的helloworld.py正常,右上角可以实时返回画面,但一运行MediaPipe BlazeFace人脸检测示例代码,IDE即与N6断连,同时电脑提示U盘已拔出。此前仅执行过IDE提示的固件升级(从旧版本升至5.0.0),未擦除FAT或重置romfs。
import csi
import time
import ml
from ml.postprocessing.mediapipe import BlazeFace
# Initialize the sensor.
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
# BlazeFace requires a square image for the best results.
csi0.window((400, 400))
# Load built-in face detection model
model = ml.Model("/rom/blazeface_front_128.tflite", postprocess=BlazeFace(threshold=0.4))
print(model)
clock = time.clock()
while True:
clock.tick()
img = csi0.snapshot()
# faces is a list of ((x, y, w, h), score, keypoints) tuples
for r, score, keypoints in model.predict([img]):
ml.utils.draw_predictions(img, [r], ("face",), ((0, 0, 255),), format=None)
# keypoints is a ndarray of shape (6, 2)
# 0 - right eye (x, y)
# 1 - left eye (x, y)
# 2 - nose (x, y)
# 3 - mouth (x, y)
# 4 - right ear (x, y)
# 5 - left ear (x, y)
ml.utils.draw_keypoints(img, keypoints, color=(255, 0, 0))
print(clock.fps(), "fps")


跟你相同的问题,目前没有找到解决办法,我运行的例程是lc person detector.py
更新到最新版本IDE,随后点击IDE右下角的固件版本,勾选重置FAT和romfs,重新烧录固件后重试
感谢,按照你说的,
问题已经解决