Giter Site home page Giter Site logo

batch的问题 about yolov8_trt HOT 4 CLOSED

WANGCHAO1996 avatar WANGCHAO1996 commented on August 15, 2024
batch的问题

from yolov8_trt.

Comments (4)

LSH9832 avatar LSH9832 commented on August 15, 2024

感谢反馈,将ultralytics/yolo/engine/exporter.py 中第165行注释掉即可

from yolov8_trt.

WANGCHAO1996 avatar WANGCHAO1996 commented on August 15, 2024

谢谢您的回复 我按照您说的注释后导出的onnx float32[8,3,640,640] 转为trt后在测试中单帧时间是减少的 但是batch=8视频测试感觉速度很慢 尽管显示的推理时间减少 ,请问这是什么原因

batch=1:
[02/09/2023-08:11:13] [I] preprocess time = 1.55475; infer time = 4.24176; postprocess time = 0.207648
[02/09/2023-08:11:13] [I] preprocess time = 1.56528; infer time = 4.70144; postprocess time = 0.446816
[02/09/2023-08:11:13] [I] preprocess time = 1.55267; infer time = 4.42013; postprocess time = 0.532928
[02/09/2023-08:11:13] [I] preprocess time = 1.55062; infer time = 4.35418; postprocess time = 0.318272
[02/09/2023-08:11:13] [I] preprocess time = 1.55472; infer time = 4.92086; postprocess time = 0.352256
[02/09/2023-08:11:13] [I] preprocess time = 1.54694; infer time = 4.4991; postprocess time = 0.202784
[02/09/2023-08:11:13] [I] preprocess time = 1.54602; infer time = 4.53914; postprocess time = 0.19776
[02/09/2023-08:11:13] [I] preprocess time = 1.55939; infer time = 4.22522; postprocess time = 0.19568

batch=8:
[02/09/2023-08:10:27] [I] preprocess time = 0.50718; infer time = 3.5722; postprocess time = 0.502048
[02/09/2023-08:10:28] [I] preprocess time = 0.508036; infer time = 3.58598; postprocess time = 0.509088
[02/09/2023-08:10:28] [I] preprocess time = 0.507736; infer time = 3.26151; postprocess time = 0.504344
[02/09/2023-08:10:28] [I] preprocess time = 0.507856; infer time = 3.25583; postprocess time = 0.505184
[02/09/2023-08:10:29] [I] preprocess time = 0.507544; infer time = 3.26184; postprocess time = 0.504592
[02/09/2023-08:10:29] [I] preprocess time = 0.508048; infer time = 3.25737; postprocess time = 0.502216
[02/09/2023-08:10:29] [I] preprocess time = 0.507568; infer time = 3.25582; postprocess time = 0.508636
[02/09/2023-08:10:30] [I] preprocess time = 0.507796; infer time = 3.24886; postprocess time = 0.5033
[02/09/2023-08:10:30] [I] preprocess time = 0.5073; infer time = 3.25684; postprocess time = 0.502984
[02/09/2023-08:10:30] [I] preprocess time = 0.550244; infer time = 3.49358; postprocess time = 0.506428
[02/09/2023-08:10:31] [I] preprocess time = 0.55456; infer time = 3.47292; postprocess time = 0.529296
[02/09/2023-08:10:31] [I] preprocess time = 0.48488; infer time = 3.0887; postprocess time = 0.504836
[02/09/2023-08:10:32] [I] preprocess time = 0.484532; infer time = 3.08768; postprocess time = 0.504032
[02/09/2023-08:10:32] [I] preprocess time = 0.485148; infer time = 3.09106; postprocess time = 0.50042
[02/09/2023-08:10:32] [I] preprocess time = 0.484668; infer time = 3.07816; postprocess time = 0.500792
[02/09/2023-08:10:33] [I] preprocess time = 0.484952; infer time = 3.08939; postprocess time = 0.499584

from yolov8_trt.

LSH9832 avatar LSH9832 commented on August 15, 2024

单进程中每处理8帧后再一起显示,所以感觉一卡一卡的,如果想要观感流畅,需要至少两个进程,一个进程负责推理,另一个负责显示图像,可参考https://github.com/LSH9832/edgeyolo中的batch_detect.py写一个多进程脚本

from yolov8_trt.

WANGCHAO1996 avatar WANGCHAO1996 commented on August 15, 2024

单进程中每处理8帧后再一起显示,所以感觉一卡一卡的,如果想要观感流畅,需要至少两个进程,一个进程负责推理,另一个负责显示图像,可参考https://github.com/LSH9832/edgeyolo中的[batch_detect.py](https://github.com/LSH9832/edgeyolo/blob/main/batch_detect.py)写一个多进程脚本
好的 感谢!!

from yolov8_trt.

Related Issues (7)

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.