New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YoloV5 inference support of ONNX models #272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Could you run
./gradlew fJ build
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
Would you mind import this mode into ONNX runtime model zoo in separate PR?
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ai/djl/modality/cv/translator/YoloV5Translator.java
Outdated
Show resolved
Hide resolved
Please note I use DJL with own models however I can understand it can be good to have a sample model available and also for testing maybe, if I find some time I will PR a standard model. |
Change-Id: I5ea9c204b19dc55d88ce84c4c4275b776d6f8a3b
YoloV5 inference support of ONNX models (deepjavalibrary#272)
Revert "YoloV5 inference support of ONNX models (deepjavalibrary#272)"
cost memory leak |
Description
adds support for YoloV5 object detection models via ONNX
Changes
added YoloV5Translator with following features: input squeezer, output parser and non max suppression boxes
Howto
YoloV5 supports at least two output formats, to use models here it is important to specify model.model[-1].export = False in export.py.
An ONNX export can be done like this: ultralytics/yolov5#251
Example