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

Enable configurable confidence threshold for ov export and inference #2388

Conversation

jaegukhyun
Copy link
Contributor

@jaegukhyun jaegukhyun commented Jul 21, 2023

Summary

This PR includes enabling to control confidence threshold during eval(torch, ov models) and export.
From now on user can control confidence threshold via turning off result_based_threshold and setting confidence threshold through cli or configuration.yaml.

This is for #2291, a request for changing variables during evaluation and export procedure. Other variables such as input sizes and iou_threshold will be controlled after those variables can be controlled by configurable parameters.

How to test

  1. Train object detection model
  2. Export model through $ otx export -o outputs/exported/origin/
  3. Eval model throuhg $ otx eval --load-weights outputs/exported/origin/openvino.xml
  4. Eval model through $ otx eval --load-weights outputs/exported/origin/openvino.xml params --postprocessing.result_based_confidence_threshold false --postprocessing.confidence_threshold 0.95
  5. Export model through $ otx export -o outputs/exported/0.95/ params --postprocessing.result_based_confidence false --postprocessing.confidence_threshold 0.95
  6. Eval model through $ otx eval --load-weights outputs/exported/0.95/openvino.xml

You can see largely degraded performance in step 3 and results of step 3 and step 5 are same.

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added e2e tests for validation.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@github-actions github-actions bot added CLI Any changes in OTE CLI ALGO Any changes in OTX Algo Tasks implementation TEST Any changes in tests labels Jul 21, 2023
@jaegukhyun jaegukhyun force-pushed the configurable-confidence-threshold branch from 59d899f to 1039ce4 Compare July 24, 2023 06:00
@github-actions github-actions bot added the DOC Improvements or additions to documentation label Jul 24, 2023
@jaegukhyun jaegukhyun marked this pull request as ready for review July 24, 2023 09:23
@jaegukhyun jaegukhyun requested a review from a team as a code owner July 24, 2023 09:23
eunwoosh
eunwoosh previously approved these changes Jul 25, 2023
Copy link
Contributor

@eunwoosh eunwoosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but there is a minor typo. Could you fix it?

@sungmanc
Copy link
Contributor

You can see largely degraded performance in step 4 and results of step 4 and step 6 are same.

This sentence is confusing. I think step 2 > (step 3 = step 5) is what you intended, is it right?

Copy link
Contributor

@goodsong81 goodsong81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, but could you review the review comments including mine?

src/otx/algorithms/detection/task.py Outdated Show resolved Hide resolved
@jaegukhyun
Copy link
Contributor Author

You can see largely degraded performance in step 4 and results of step 4 and step 6 are same.

This sentence is confusing. I think step 2 > (step 3 = step 5) is what you intended, is it right?

Yeap that' right, I changed the comments.

goodsong81
goodsong81 previously approved these changes Jul 26, 2023
sungmanc
sungmanc previously approved these changes Jul 26, 2023
eunwoosh
eunwoosh previously approved these changes Jul 26, 2023
@jaegukhyun jaegukhyun dismissed stale reviews from eunwoosh, sungmanc, and goodsong81 via 56b9e98 July 26, 2023 08:21
@jaegukhyun jaegukhyun merged commit 550789b into openvinotoolkit:develop Jul 27, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ALGO Any changes in OTX Algo Tasks implementation CLI Any changes in OTE CLI DOC Improvements or additions to documentation TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants