Z
zrxf
@zrxf
0
声望
10
楼层
517
资料浏览
0
粉丝
1
关注
zrxf 发布的帖子
-
今天插上板子后电脑显示要格式化才能用e盘
今天插上板子后电脑显示要格式化才能用e盘,然后格式化清空再把三个文件存好之后就一直显示错误检测不到labels. txt,前两天都是好的
[0_1609434976913_IMG_20201231_190452.jpg](正在上传 87%)
-
想做图像识别根据不同分类控制舵机,为什么一直显示不可以,想知道程序哪里有问题?谢谢谢谢
# Edge Impulse - OpenMV Image Classification Example import sensor, image, time, os, tf, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.set_windowing((240, 240)) # Set 240x240 window. sensor.skip_frames(time=2000) # Let the camera adjust. net = "trained.tflite" labels = [line.rstrip('\n') for line in open("labels.txt")] clock = time.clock() while(True): clock.tick() img = sensor.snapshot() # default settings just do one detection... change them to search the image... for obj in tf.classify(net, 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())) for i in range(len(predictions_list)): print("%s = %f" % (predictions_list[i][0], predictions_list[i][1])) print(clock.fps(), "fps") from pyb import Servo s1 = Servo(1) # P7 s2 = Servo(2) # P8 #s3 = Servo(3) # P9 Only for OpenMV3 M7 while True: img = sensor.snapshot() answer = img.find_blobs() if x > 0.6 # for i in range(-90,90): s1.angle(10) #s2.angle(i) time.sleep(10) # for i in range(90,-90): # s1.angle(i) #s2.angle(i) #time.sleep(10)