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

Adapt input size automatically based on dataset statistics #2499

Merged
merged 34 commits into from
Sep 20, 2023

Conversation

goodsong81
Copy link
Contributor

@goodsong81 goodsong81 commented Sep 13, 2023

Summary

  • Classification / Segmentation

    • Set input size based on typical large image size in dataset
    • If larger than the default size, keep default size
    • ex) There's no much impact as most of datasets have images > 224x224.
  • Detection / Instance segmentation

    • Set input size based on typical large image size in dataset
    • Adjust input size based on typical small shape annotation size in dataset
    • If larger than the default size, keep default size
    • ex) "Peanut" dataset for object detection

image

  • Set "Auto" as default for all models

How to test

[Example CMD]

otx train src/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml --train-data-roots ./data/peanut --workspace outputs/load-resize-det/feat/load-resize-cache-detiseg/peanut_cspdarknet_yolox_256x256_cache2g params --learning_parameters.input_size Auto --algo_backend.mem_cache_size 1000000000

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

Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
@goodsong81 goodsong81 added the FEATURE New feature & functionality label Sep 13, 2023
@github-actions github-actions bot added ALGO Any changes in OTX Algo Tasks implementation TEST Any changes in tests labels Sep 13, 2023
@goodsong81 goodsong81 added this to the 1.5.0 milestone Sep 13, 2023
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
@github-actions github-actions bot added the DOC Improvements or additions to documentation label Sep 15, 2023
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
@goodsong81 goodsong81 marked this pull request as ready for review September 19, 2023 04:48
@goodsong81 goodsong81 requested a review from a team as a code owner September 19, 2023 04:48
@goodsong81 goodsong81 requested a review from eunwoosh September 19, 2023 05:45
Copy link
Contributor

@sungmanc sungmanc left a comment

Choose a reason for hiding this comment

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

I left minor comments, BTW, this PR needs the documentation. Will it be done at the upcoming PR? And just wondering about the performance change between before (develop) and after (this patch), no big differences?

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.

Thanks for your work! It's a nice feature. I left some comments, please take a look.

@goodsong81
Copy link
Contributor Author

I left minor comments, BTW, this PR needs the documentation. Will it be done at the upcoming PR? And just wondering about the performance change between before (develop) and after (this patch), no big differences?

Thank you for the feedback. I would add documentation in a dedicated PR.
In addition, I'm thinking of reverting the default mode of "Auto" but enable this option in integration test. Turning it will be also handled in other PR if decided.

Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
@goodsong81
Copy link
Contributor Author

I left minor comments, BTW, this PR needs the documentation. Will it be done at the upcoming PR? And just wondering about the performance change between before (develop) and after (this patch), no big differences?

Thank you for the feedback. I would add documentation in a dedicated PR. In addition, I'm thinking of reverting the default mode of "Auto" but enable this option in integration test. Turning it will be also handled in other PR if decided.

Ah, I've just updated the document.

@goodsong81 goodsong81 enabled auto-merge (squash) September 20, 2023 07:37
@goodsong81 goodsong81 merged commit 45a4bcd into openvinotoolkit:develop Sep 20, 2023
@goodsong81 goodsong81 deleted the feat/auto-input-size branch September 20, 2023 07:46
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 DOC Improvements or additions to documentation FEATURE New feature & functionality TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants