zoukankan      html  css  js  c++  java
  • 2020年大三下学期第十八周学习心得

    主要在复习操作系统,但是通过学习,我做了一个逐帧检测画面识别各个物体数量的功能。

     for i in indices:
                i = i[0]
                box = boxes[i]
                left = box[0]
                top = box[1]
                width = box[2]
                height = box[3]
                print(str(classes[classIds[i]]))
                if(str(classes[classIds[i]])=="person"):
                    person+=1
                    num=[person,car,motorbike,bus,bicycle]
                if(str(classes[classIds[i]])=="car"):
                    car+=1
                    num=[person,car,motorbike,bus,bicycle]
                if (str(classes[classIds[i]]) == "motorbike"):
                    motorbike += 1
                    num = [person, car, motorbike, bus,bicycle]
                if (str(classes[classIds[i]]) == "bus"):
                    bus += 1
                    num = [person, car, motorbike, bus,bicycle]
                if (str(classes[classIds[i]]) == "bicycle"):
                    bicycle += 1
                    num = [person, car, motorbike, bus,bicycle]
            return num
    

      

     label = 'Inference time: %.2f ms' % (t * 1000.0 / cv.getTickFrequency())
        cv.putText(frame, label, (0, 15), cv.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255))
        label = 'Person num:%s' % (postprocess2(frame,outs)[0])
        cv.putText(frame, label, (0, 30), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 0))
        label = 'Car num:%s' % (postprocess2(frame, outs)[1])
        cv.putText(frame, label, (0, 45), cv.FONT_HERSHEY_SIMPLEX, 0.5, (240, 255, 255))
        label = 'Motorbike num:%s' % (postprocess2(frame, outs)[2])
        cv.putText(frame, label, (0, 60), cv.FONT_HERSHEY_SIMPLEX, 0.5, (245, 245, 245))
        label = 'Bus num:%s' % (postprocess2(frame, outs)[3])
        cv.putText(frame, label, (0, 75), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 97, 0))
        label = 'Bicycle num:%s' % (postprocess2(frame, outs)[4])
        cv.putText(frame, label, (0, 90), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 230, 201))
        # Write the frame with the detection boxes
    

      截图:

  • 相关阅读:
    Mysql表连接查询
    mysql查询语句 和 多表关联查询 以及 子查询
    MySql 模糊查询、范围查询
    Mysql外键约束设置使用方法
    python基础:re模块匹配时贪婪和非贪婪模式
    解决Ubuntu 16.04下提示boot分区空间不足的办法
    String,StringBuffer,StringBuilder的区别
    多线程模拟生产者和消费者模型
    线程同步处理
    多线程的三种实现
  • 原文地址:https://www.cnblogs.com/jccjcc/p/13098167.html
Copyright © 2011-2022 走看看