Skip to content

the yolov5 model performance runned by DJL is poor #3378

Answered by frankfliu
zhangkai253 asked this question in Q&A
Discussion options

You must be logged in to vote

@zhangkai253

The current Yolov5Translator resize the image to 640x640, but detect.py pad the image to 640x640, this causing detection quality reduced.

You can manually pad your image to 640x640, and you will get the same result.

I created a PR to add a CenterFit image operation to solve this issue: #3425
Once this PR is merged you can use the follow code to get the result:

        Criteria<Image, DetectedObjects> criteria =
                Criteria.builder()
                        .setTypes(Image.class, DetectedObjects.class)
                        .optModelPath(Paths.get("best.pt"))
                        .optTranslatorFactory(new YoloV5TranslatorFactory())
                        .op…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@frankfliu
Comment options

@zhangkai253
Comment options

@frankfliu
Comment options

@zhangkai253
Comment options

@frankfliu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by zhangkai253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants