MaixPy-v1 icon indicating copy to clipboard operation
MaixPy-v1 copied to clipboard

I use YOLO to inspect car images. But I don't know how to count car pictures yet. Help me at

Open Name1112 opened this issue 4 years ago • 3 comments

I am now able to detect images of the car. by drawing up a frame But I don't know how to use this frame to be able to count frames. Help me at

Code: import sensor,image,lcd,time import KPU as kpu from Corgi85 import corgi85 import random

lcd.init() lcd.rotation(2)

sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.set_vflip(0) sensor.set_hmirror(0) sensor.run(1)

classes = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'] task = kpu.load(0x500000) a = kpu.set_outputs(task, 0, 7,7,35) anchor = (1.889, 2.5245, 2.9465, 3.94056, 3.99987, 5.3658, 5.155437, 6.92275, 6.718375, 9.01025) a = kpu.init_yolo2(task, 0.5, 0.3, 5, anchor) clock = time.clock()

while(True): clock.tick() img = sensor.snapshot() setto = kpu.run_yolo2(task, img)

if setto:
    for i in setto:

        if i.classid() == 6 : 
            a=img.draw_rectangle(i.rect(),color = (0, 255, 0),thickness=4)
            a=img.draw_string(i.x(), i.y(), classes[i.classid()], color=(0, 255, 0),scale=2)

lcd.display(img)

a = kpu.deinit(task)

Name1112 avatar Sep 22 '21 13:09 Name1112

This is not a forum. Ask your question in the sipeed forum Your question is super simple but you obviously have 0 programming skills Go learn programming and will learn how to count this is most basic thing in programming of any programming language

easy-and-simple avatar Sep 22 '21 15:09 easy-and-simple

Can you tell me how to count? I'm just starting to study so I don't understand a lot. Thank you.

Name1112 avatar Sep 22 '21 22:09 Name1112

You can't understand even that this is not forum! Maybe you should go to school at first to learn some basics?!

easy-and-simple avatar Sep 22 '21 22:09 easy-and-simple