Skip to content
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

To support Yolov8 #2776

Merged
merged 19 commits into from
Sep 20, 2023
Merged

To support Yolov8 #2776

merged 19 commits into from
Sep 20, 2023

Conversation

SidneyLann
Copy link
Contributor

@SidneyLann SidneyLann commented Sep 12, 2023

Description

extends YoloV5Translator to support Yolov8 for #2753

  • If this change is a backward incompatible change, why must this change be made?
  • Interesting edge cases to note here

Administrator and others added 2 commits September 12, 2023 16:39
@KexinFeng
Copy link
Contributor

Hi Sidney,

Thanks for contributing this feature which has been called for by many people. But current the new translator is not fully tested. Could you share your code that utilizes this yolov8 translator? It can be similar to the code below.

examples/src/main/java/ai/djl/examples/inference/MaskDetection.java
examples/src/main/java/ai/djl/examples/inference/ObjectDetection.java

Then it will demonstrate how your yolov8 tranlator is called.

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2023

Codecov Report

Patch coverage: 54.60% and project coverage change: +0.05% 🎉

Comparison is base (bb5073f) 72.08% compared to head (8ea1f6c) 72.14%.
Report is 882 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2776      +/-   ##
============================================
+ Coverage     72.08%   72.14%   +0.05%     
- Complexity     5126     7089    +1963     
============================================
  Files           473      702     +229     
  Lines         21970    31570    +9600     
  Branches       2351     3267     +916     
============================================
+ Hits          15838    22777    +6939     
- Misses         4925     7239    +2314     
- Partials       1207     1554     +347     
Files Changed Coverage Δ
api/src/main/java/ai/djl/modality/cv/Image.java 69.23% <ø> (-4.11%) ⬇️
...rc/main/java/ai/djl/modality/cv/MultiBoxPrior.java 76.00% <ø> (ø)
.../main/java/ai/djl/modality/cv/output/Landmark.java 100.00% <ø> (ø)
...djl/modality/cv/transform/RandomFlipLeftRight.java 25.00% <0.00%> (-25.00%) ⬇️
...djl/modality/cv/transform/RandomFlipTopBottom.java 25.00% <0.00%> (-25.00%) ⬇️
...i/djl/modality/cv/translator/BigGANTranslator.java 21.42% <0.00%> (-5.24%) ⬇️
.../modality/cv/translator/ImageFeatureExtractor.java 0.00% <0.00%> (ø)
.../ai/djl/modality/cv/translator/YoloTranslator.java 27.77% <0.00%> (+18.95%) ⬆️
...ain/java/ai/djl/modality/cv/util/NDImageUtils.java 67.10% <0.00%> (+7.89%) ⬆️
api/src/main/java/ai/djl/modality/nlp/Decoder.java 63.63% <ø> (ø)
... and 226 more

... and 372 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SidneyLann
Copy link
Contributor Author

Hi Sidney,

Thanks for contributing this feature which has been called for by many people. But current the new translator is not fully tested. Could you share your code that utilizes this yolov8 translator? It can be similar to the code below.

examples/src/main/java/ai/djl/examples/inference/MaskDetection.java examples/src/main/java/ai/djl/examples/inference/ObjectDetection.java

Then it will demonstrate how your yolov8 tranlator is called.

new commit is rejected. can't commit after All checks have passed?

@SidneyLann
Copy link
Contributor Author

new commit is rejected. can't commit after All checks have passed?

@SidneyLann
Copy link
Contributor Author

image

@SidneyLann
Copy link
Contributor Author

You can merge this PR and I will do the example in another PR.

@KexinFeng
Copy link
Contributor

KexinFeng commented Sep 13, 2023

Hi @SidneyLann , this rejection of commit is actually a very common issue at the beginning of using git. It's because there is some update commits at the remote repo (in this case the "formate" commits I made) that hasn't been fetched to the local before pushing the local to the remote. So just first update the local repo by git pull(which may require further conflict resolving) and then do git push, or do as what bing chat suggests:

git pull --rebase origin <name-of-the-remote-branch>

<name-of-the-remote-branch> = yolo8 in this case.

Then do git push origin <name-of-the-remote-branch> to update the remote repo.

The following is the search result of "rejected non-fast-forward"

[The “non-fast-forward” error in Git usually occurs when you try to push your local changes to a remote repository, but the current branch on your local repository is behind its remote counterpart] [This means that there have been changes on the remote repository that you haven’t incorporated into your local repository]
...

We are considering doing some optimizations on the function protected DetectedObjects processFromBoxOutput(NDList list) to reduce the number of calls of toFloat (since it involvs jni calls which is a little more expensive). So maybe let's add the example here, so that we can use it for that effiency optimization.

@KexinFeng KexinFeng self-requested a review September 16, 2023 19:26
@KexinFeng KexinFeng merged commit 950340f into deepjavalibrary:master Sep 20, 2023
5 checks passed
@SidneyLann SidneyLann deleted the yolo8 branch September 20, 2023 08:33
frankfliu pushed a commit that referenced this pull request Apr 26, 2024
---------

Co-authored-by: KexinFeng <fenkexin@amazon.com>
siddvenk pushed a commit to siddvenk/djl that referenced this pull request May 20, 2024
---------

Co-authored-by: Administrator <Administrator@tech8>
Co-authored-by: KexinFeng <fenkexin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants