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

Clean up and refactor the output of the OTX CLI #1946

Merged
merged 22 commits into from
Mar 30, 2023

Conversation

harimkang
Copy link
Contributor

@harimkang harimkang commented Mar 28, 2023

Summary

Clean up OTX's unorganized output and policies, and various arguments related to output.

  • New feature
    • New args in CLI

      • AS-IS (otx v1.1) -> TO-BE (this PR)
        • --work-dir -> --workspace : otx workspace path.
        • --save-model-to & --save-performance -> --output : output directory path.
    • New output
      image

  • added some feedbacks
    • Remove symlink for export & optimize: This can create unnecessary links outside of the workspace.
    • Raise error when otx deploy runs without --load-weights: because the exported model is no longer found in latest
    • Rename output: openvino_models -> openvino & latest -> latest_trained_model
    • Link parent path of otx train result output to latest_trained_model : Link models only -> Link models & logs
      image

How to test

# auto-config or train with args
(otx) otx train --train-data-roots data/path

# or build & train
(otx) otx build --task classification
(otx) otx {train, eval, export, optimize}

Checklist

License

  • I submit my code changes under the same MIT 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: MIT

@harimkang harimkang added this to the 1.2.0 milestone Mar 28, 2023
@harimkang harimkang requested a review from a team as a code owner March 28, 2023 01:55
@github-actions github-actions bot added 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 labels Mar 28, 2023
@harimkang harimkang requested a review from eunwoosh March 28, 2023 02:11
@harimkang harimkang added the ENHANCE Enhancement of existing features label Mar 28, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2023

Codecov Report

Patch coverage: 73.03% and project coverage change: -0.03 ⚠️

Comparison is base (6754fda) 80.72% compared to head (652af52) 80.69%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1946      +/-   ##
===========================================
- Coverage    80.72%   80.69%   -0.03%     
===========================================
  Files          482      482              
  Lines        33221    33244      +23     
===========================================
+ Hits         26818    26827       +9     
- Misses        6403     6417      +14     
Impacted Files Coverage Δ
otx/cli/tools/demo.py 28.57% <0.00%> (ø)
otx/cli/tools/explain.py 24.52% <0.00%> (ø)
otx/cli/manager/config_manager.py 83.08% <57.14%> (-1.69%) ⬇️
otx/cli/tools/eval.py 81.66% <60.00%> (ø)
otx/cli/tools/train.py 81.18% <61.53%> (-0.26%) ⬇️
otx/cli/tools/export.py 89.79% <63.63%> (-3.54%) ⬇️
otx/algorithms/common/tasks/training_base.py 52.81% <66.66%> (+0.11%) ⬆️
otx/cli/tools/optimize.py 89.55% <71.42%> (-2.39%) ⬇️
otx/cli/tools/build.py 89.47% <100.00%> (-0.78%) ⬇️
otx/cli/tools/deploy.py 97.29% <100.00%> (+4.44%) ⬆️
... and 2 more

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Overall LGTM, this is the pretty good improvement :)

BTW, for the deploy, eval, export, optimize, and train.py, will we support -o argument?
In the documentation, there is no description for -o argument. So, how about removing this argument?

  • We have 3 scenarios as below, how about adding simple unit-tests for these scenarios?
  1. --output (no --workspace)
  2. --workspace (no --output)
  3. --workspace + --output

@eunwoosh
Copy link
Contributor

Overall LGTM, this is the pretty good improvement :)

BTW, for the deploy, eval, export, optimize, and train.py, will we support -o argument? In the documentation, there is no description for -o argument. So, how about removing this argument?

  • We have 3 scenarios as below, how about adding simple unit-tests for these scenarios?
  1. --output (no --workspace)
  2. --workspace (no --output)
  3. --workspace + --output

IMHO, -o is also good argument to use. How about to update documentation instead of removing it?

otx/cli/manager/config_manager.py Outdated Show resolved Hide resolved
otx/cli/tools/build.py Outdated Show resolved Hide resolved
otx/cli/tools/deploy.py Show resolved Hide resolved
otx/cli/tools/eval.py Show resolved Hide resolved
@harimkang
Copy link
Contributor Author

We decided to move the latest folder to outputs.
I'm also going to add an integration test to check the CLI behavior with or without --output or --workspace and test for file creation checking.

This is currently working as expected, so I'm going to leave the PR open for reviews, and I'd love to hear your thoughts on this PR. :)

jaegukhyun
jaegukhyun previously approved these changes Mar 29, 2023
Copy link
Contributor

@jaegukhyun jaegukhyun left a comment

Choose a reason for hiding this comment

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

I looked only code parts(it's really hard to look docs and test files...), and the code works look really good to me. Thank you for your effort

jaegukhyun
jaegukhyun previously approved these changes Mar 29, 2023
tests/integration/cli/test_cli.py Outdated Show resolved Hide resolved
tests/integration/cli/test_cli.py Outdated Show resolved Hide resolved
tests/integration/cli/test_cli.py Outdated Show resolved Hide resolved
tests/integration/cli/test_cli.py Outdated Show resolved Hide resolved
@harimkang harimkang merged commit 00c3ef7 into openvinotoolkit:develop Mar 30, 2023
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 ENHANCE Enhancement of existing features TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants