GithubHelp home page GithubHelp logo

jason-li-831202 / yolo-nas-onnxruntime Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 7.0 107.96 MB

This repo provides the C++ implementation of YOLO-NAS based on ONNXRuntime for performing object detection in real-time.Support float32/float16/int8 inference.

License: GNU General Public License v3.0

CMake 2.47% Shell 2.40% Python 28.22% C++ 66.91%
cpp onnxruntime python yolo-nas object-detection pytorch yolo

yolo-nas-onnxruntime's Introduction

Kai-Chun,Li Home !

GitHub Followers YouTube Channel Subscribers YouTube Channel Views

📇  Coding Stats

TopLanguage


VISITOR COUNT : - Starting from 2023/05/11. -

yolo-nas-onnxruntime's People

Contributors

jason-li-831202 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yolo-nas-onnxruntime's Issues

doesnt work on custom dataset

Hello, this works perfect on default coco model but doesnt work on a custom one.
Did you try this yourself cause it does not work on custom model with checkpoint. Predictions don't work and are negative numbers.

Is compatible with latest onnxruntime (1.15.0) ?

Hello, I'm encountering an error while attempting to build with the latest version of onnxruntime on Apple Silicon. Unfortunately, previous versions of onnxruntime do not have a release specifically for Apple Silicon architecture.

Error:

[ 25%] Building CXX object CMakeFiles/demo.dir/src/main.cpp.o
[ 50%] Building CXX object CMakeFiles/demo.dir/src/detector.cpp.o
/Users/alan/Sites/YOLO-NAS-onnxruntime/src/detector.cpp:55:44: error: no member named 'GetInputName' in 'Ort::Session'
        inputNames.push_back(this->session.GetInputName(layer, allocator));
                             ~~~~~~~~~~~~~ ^
/Users/alan/Sites/YOLO-NAS-onnxruntime/src/detector.cpp:78:45: error: no member named 'GetOutputName' in 'Ort::Session'
        outputNames.push_back(this->session.GetOutputName(layer, allocator));
                              ~~~~~~~~~~~~~ ^
2 errors generated.
make[2]: *** [CMakeFiles/demo.dir/src/detector.cpp.o] Error 1
make[1]: *** [CMakeFiles/demo.dir/all] Error 2
make: *** [all] Error 2

Help me with implementing this project.

It seems like a really good project. But since I am a beginner in C++, I am not sure how to implement this.

When I try the CLI, it shows ./demo is not a internal or recognized command.

Could you please provide me with a step by step procedure? I am familiar with Pytorch implementation of YOLO-NAS and would like to compare both these implementations.

Thanks and have a great day!

About model chooses

There are only three choices in the Comvert Pytorch to ONNX model parameter, are there other models available, such as the basic yolov7 v8 model?

When I try to run the code, I get always Ort::exception even running on image or video

Hi! I have an converted (not custom, default COCO) Yolo-NAS-S model from default .pth to ONNX. When I execute the program by using following arguments:

./demo -m ~/models/dnn/yolo_nas_s.onnx -s 0 -c ~/Downloads/coco.names

I get this error when trying to execute on video detection (this is whole log):

[INFO ] Onnxruntime Version:16
[INFO ] Inference device: CPU
[INFO ] Inference model: /home/uki/models/dnn/yolo_nas_s.onnx
[INFO ] ---------------- Input info --------------
[INFO ] Name [0]: input.1
[INFO ] Shape [0]: (1, 3, 640, 640, )
[INFO ] --------------- Output info --------------
[INFO ] Name [0]: 913
[INFO ] Shape [0]: (1, 8400, 4, )
[INFO ] Name [1]: 904
[INFO ] Shape [1]: (1, 8400, 80, )
[INFO ] Class num: -1
[INFO ] ==========================================
[INFO ] Model was initialized.
[INFO ] Current FPS : 30
terminate called after throwing an instance of 'Ort::Exception'
  what():  Invalid Output Name:h���
Aborted (core dumped)

And this error with image, even if given image is properly working, ends .jpg as code needs, and it is tested with OpenCV test code, what gives proper results. This is also an full log:

[INFO ] =============== Model info ===============
[INFO ] Onnxruntime Version:16
[INFO ] Inference device: CPU
[INFO ] Inference model: /home/uki/models/dnn/yolo_nas_s.onnx
[INFO ] ---------------- Input info --------------
[INFO ] Name [0]: input.1
[INFO ] Shape [0]: (1, 3, 640, 640, )
[INFO ] --------------- Output info --------------
[INFO ] Name [0]: 913
[INFO ] Shape [0]: (1, 8400, 4, )
[INFO ] Name [1]: 904
[INFO ] Shape [1]: (1, 8400, 80, )
[INFO ] Class num: -1
[INFO ] ==========================================
[INFO ] Model was initialized.
terminate called after throwing an instance of 'Ort::Exception'
  what():  Invalid Output Name:eg;*.jpg;*.jpe)

I am using the latest version of ONNX Runtime, 1.16.3.
The ONNX file is tested, it works properly.

So when I debugged with Visual Studio Code, I get the error specifically at this line, when it tries to get an outputNames.size(), e.g. when it runs an session.Run (get detection results):

std::vector<Ort::Value> outputTensors = this->session.Run(Ort::RunOptions{nullptr},
                                                              inputNames.data(),
                                                              inputTensors.data(),
                                                              inputNames.size(),
                                                              outputNames.data(),
                                                              outputNames.size() );

Do you know what maybe is issue? Thanks in advance. If you need more info, please leave a comment.

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.