Code Monkey home page Code Monkey logo

Comments (1)

cfzd avatar cfzd commented on June 5, 2024 4

@liluxing153
一般来说,网络的推理速度指的是神经网络跑完一次forward的速度,也就是上面

with torch.no_grad():
    pred = net(img)

这一句的时间,按照你的速度应该也有200FPS,这个是比较通用的做法。

那为什么图像预处理或者后处理的时间不算呢?这主要是因为在真实的系统中,相机采集的数据是直接在内存中的,后端的网络输入是可以直接对接内存中的相机数据的,所以你在img_transforms中从硬盘读取的时间、转换成RGB的时间、归一化的时间、再把它挪到cuda内存上等等的时间都是不存在的。

那么后处理呢?其实你观察后处理的代码就可以发现核心的逻辑就是一个softmax再加上一个乘法求期望,这点计算量相比于神经网络的计算量九牛一毛,为什么还会比网络推理慢呢?这主要是由于为了方便用python的循环实现的,如果真正部署换成其他的方式,这点计算量是几乎没有延迟的。

综上,计算网络速度是看的网络推理速度,这也是一般的通用做法。

from ultra-fast-lane-detection-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.