GithubHelp home page GithubHelp logo

Comments (6)

itsnine avatar itsnine commented on May 22, 2024 2

@zhiqwang hello, I'm currently working on the same task, writing onnxruntime c++ inference code, you can see what I've done here: https://github.com/itsnine/yolov5-onnxruntime. Note that I export yolov5 model to onnx using official script.
Don't you mind if I contribute to YOLO v5 Runtime Stack project when I'm done with the code? What do you think about that?

from yolort.

zhiqwang avatar zhiqwang commented on May 22, 2024 2

Hi @itsnine ,

We would be delighted if you would contribute this feature. Feel free to pin me if you encounter any problems.

The default ONNX model we export here differs from the official one in following three main ways.

  • The exported ONNX graph now supports dynamic shapes, and we use (3, H, W) (for example (3, 640, 640)) as the input shape.
  • We embed the post-processing (nms) into the model graph, and you can check #159 (comment) for more details about this. (Here the ONNX graph is required to be dynamic.)
  • We embed the pre-processing (letterbox) into the graph as well. We require the input image to be in the RGB channel, and to be rescaled to float32 [0-1] from general uint [0-255]. The main logic we use to implement this mechanism is below. (And this plays the same role of the official letterbox, but there will be a little difference in accuracy now.)
    https://github.com/zhiqwang/yolov5-rt-stack/blob/b9c67205a61fa0e9d7e6696372c133ea0d36d9db/yolort/models/transform.py#L249-L258

Let me know your thoughts or considerations about these three options.

from yolort.

zhiqwang avatar zhiqwang commented on May 22, 2024 1

Note that I export yolov5 model to onnx using official script. Don't you mind if I contribute to YOLO v5 Runtime Stack project when I'm done with the code? What do you think about that?

Hi @itsnine , Yep, this could also be an option, and I would very much welcome this feature.

from yolort.

itsnine avatar itsnine commented on May 22, 2024 1

@zhiqwang Okay, I'll try to write c++ inference code for this type of onnx yolov5 with embedded nms and letterbox :) Actually that's awesome idea to add pre- and post-processing parts to the onnx graph. You mentioned about dynamic shape, but what about batched inference?

from yolort.

itsnine avatar itsnine commented on May 22, 2024 1

@zhiqwang I inferenced your yolov5 ONNX model with embedded pre- and post-processing in c++, it works! I'll do PR when I'm done with the code :)

from yolort.

zhiqwang avatar zhiqwang commented on May 22, 2024

You mentioned about dynamic shape, but what about batched inference?

Hi @itsnine , This is a good question and one that yolort has already had, I file an issue #45 about it earlier, you can check this discussion #39 for more details.

from yolort.

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.