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

Add mmdeploy export #2806

Merged
merged 209 commits into from
Feb 6, 2024
Merged

Add mmdeploy export #2806

merged 209 commits into from
Feb 6, 2024

Conversation

eunwoosh
Copy link
Contributor

@eunwoosh eunwoosh commented Jan 17, 2024

Summary

This PR enables mmdeploy export to OTX2.0. Currently, detection and instance segmentation need mmdeploy for export.
This PR includes

  • modify Exporter design for mmdeploy
  • Add MMdeployExporter
  • Add mmdeploy config for models
  • Fix OVInstanceSegmentationModel

TBD

  • This PR doesn't support exporting tiling.

Difference between mmdeploy export in OTX 1.X and OTX 2.0

When exporting a model w/ mmdeploy in OTX, model is converted to ONNX and ONNX is converted to OV.
In OTX 1.X, mmdeploy is used for both conversion but OTX 2.0 uses OpenVINO to convert ONNX model to OV.
It's for not falling behind latest update in OV because current latest mmdeploy is still using OpenVINO 22.03 but current latest version is 23.02.
I also removed unused code as mmdeploy ONNX -> OV is dropped.

Update integration test.

Export model score can be unstable if a model isn't fully trained.
To prevent it, some detection models get more epoch.
maskrcnn_swint isn't trained at all, so skip it in the test.

python format mmdeploy config

Because config files given by mmdeploy has python format as default,
I leave it as it is not to give user additional burden to get mmdeploy configs for new models in OTX.

P.S. I bring some code unused now but for future (e.g. export tilling, configurable parameter related setting)

How to test

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

sovrasov and others added 30 commits January 11, 2024 11:37
* added proper configs

* minor

* fix config

* fix head, updated configs

* fix pre-commit. Part 1

* fix pre-commit. Part 2

* fix pre-commit. Part3

* added default numbers for HW, mean and scale
…lkit#2797)

* refactored export

* change export to onnx

* fix pre-commit. part 1
harimkang
harimkang previously approved these changes Feb 2, 2024
sovrasov
sovrasov previously approved these changes Feb 2, 2024
@eunwoosh eunwoosh dismissed stale reviews from sovrasov and harimkang via d843660 February 2, 2024 11:29
sovrasov
sovrasov previously approved these changes Feb 2, 2024
harimkang
harimkang previously approved these changes Feb 2, 2024
@eunwoosh eunwoosh dismissed stale reviews from harimkang and sovrasov via d6d27fd February 5, 2024 11:03
@github-actions github-actions bot removed the TEST Any changes in tests label Feb 5, 2024
sovrasov
sovrasov previously approved these changes Feb 5, 2024
@github-actions github-actions bot added the TEST Any changes in tests label Feb 5, 2024
sovrasov
sovrasov previously approved these changes Feb 5, 2024
@eunwoosh eunwoosh requested a review from harimkang February 6, 2024 00:33
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.

It seems that there are many TODO or workaround in this PR. Could we make the separate backlog for those issues to avoid the missing ?

src/otx/algo/detection/mmdeploy/atss.py Outdated Show resolved Hide resolved
src/otx/core/exporter/base.py Outdated Show resolved Hide resolved
@yunchu
Copy link
Contributor

yunchu commented Feb 6, 2024

For you guys information, currently there is an issue using the mmdeploy to the v1. that's related with the protobuf package that is used by mmdeploy and the protobuf v3 has some vulnerability issue so that required to be updated to the v4 but the latest version of mmdeploy used v3 yet.

@eunwoosh eunwoosh requested review from sungmanc and sovrasov February 6, 2024 07:30
pyproject.toml Show resolved Hide resolved
@eunwoosh eunwoosh merged commit e3cc66f into openvinotoolkit:v2 Feb 6, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUILD DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants