Coder Social home page Coder Social logo

tensorrt-yolov5's Issues

looks like the way you calculate the FPS is wrong

in yolov5.cpp, line 526:
'''
auto start = std::chrono::system_clock::now();
doInference(*context, stream, buffers, data, prob, BATCH_SIZE);
auto end = std::chrono::system_clock::now();
int fps = 1000.0/std::chrono::duration_caststd::chrono::milliseconds(end - start).count();
'''
end-start is only the infer time, time for pre and post process should be included when calculating the FPS,like below:
'''
auto start1 = std::chrono::system_clock::now();
for (int f = 0; f < (int)file_names.size(); f++) {
... ...
doInference(*context, stream, buffers, data, prob, BATCH_SIZE);
auto end1 = std::chrono::system_clock::now();
int fps = 1000.0/std::chrono::duration_caststd::chrono::milliseconds(end1 - start1).count();
start1 = std::chrono::system_clock::now();
}
in this way end-start contains time for one loop.

Error when trying to run using CSI Camera

Hi @tuyaliang, I tried using this script using my USB webcam and it worked perfectly, however when trying it using my Raspberry Pi v2 CSI camera, I ran into the following error and a pop-up window opened displaying a green screen:

skymind@skymind:~/yolov5-tensorrt-openjetson/build$ sudo ./yolov5 -v
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Gtk-Message: 16:18:00.782: Failed to load module "canberra-gtk-module"

Would really appreciate any help in solving this problem. Thanks.

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.