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 ShiftAnalyzer to compute covariate and label shift between two datasets #855

Merged
merged 16 commits into from
Mar 17, 2023

Conversation

wonjuleee
Copy link
Contributor

@wonjuleee wonjuleee commented Mar 14, 2023

Summary

How to test

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

datumaro/plugins/searcher.py Outdated Show resolved Hide resolved
datumaro/plugins/shift_analyzer.py Outdated Show resolved Hide resolved
datumaro/plugins/shift_analyzer.py Outdated Show resolved Hide resolved
tests/unit/test_shift_analyzer.py Show resolved Hide resolved
datumaro/plugins/openvino_plugin/launcher.py Outdated Show resolved Hide resolved
tests/unit/test_shift_analyzer.py Outdated Show resolved Hide resolved
tests/unit/test_shift_analyzer.py Outdated Show resolved Hide resolved
tests/unit/test_shift_analyzer.py Outdated Show resolved Hide resolved
tests/unit/test_shift_analyzer.py Outdated Show resolved Hide resolved
Comment on lines +112 to +135
if model_name:
model_dir = os.path.join(os.path.expanduser("~"), ".cache", "datumaro")
if not osp.exists(model_dir):
os.makedirs(model_dir)

# Please visit open-model-zoo repository for OpenVINO public models if you are interested in
# https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md
url_folder = "https://storage.openvinotoolkit.org/repositories/datumaro/models/"

description = osp.join(model_dir, model_name + ".xml")
if not osp.exists(description):
cached_description_url = osp.join(url_folder, model_name + ".xml")
log.info('Downloading: "{}" to {}\n'.format(cached_description_url, description))
self._download_file(cached_description_url, description)

weights = osp.join(model_dir, model_name + ".bin")
if not osp.exists(weights):
cached_weights_url = osp.join(url_folder, model_name + ".bin")
log.info('Downloading: "{}" to {}\n'.format(cached_weights_url, weights))
self._download_file(cached_weights_url, weights)

if not interpreter:
openvino_plugin_samples_dir = get_samples_path()
interpreter = osp.join(openvino_plugin_samples_dir, model_name + "_interp.py")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it is more appropriate to move the model download functionality to _OpenvinoImporter but leave it in this PR.

@vinnamkim vinnamkim added this to the 1.1.0 milestone Mar 17, 2023
@vinnamkim vinnamkim added the ENHANCE Enhancement of existing features label Mar 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Patch coverage: 74.31% and project coverage change: -0.02 ⚠️

Comparison is base (36c2d4b) 78.59% compared to head (3aa96b3) 78.57%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #855      +/-   ##
===========================================
- Coverage    78.59%   78.57%   -0.02%     
===========================================
  Files          201      205       +4     
  Lines        24534    24726     +192     
  Branches      4957     4985      +28     
===========================================
+ Hits         19282    19428     +146     
- Misses        4141     4180      +39     
- Partials      1111     1118       +7     
Flag Coverage Δ
macos-11_Python-3.8 77.54% <22.94%> (-0.40%) ⬇️
ubuntu-20.04_Python-3.8 78.56% <74.31%> (-0.02%) ⬇️
windows-2019_Python-3.8 78.50% <74.31%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../openvino_plugin/samples/googlenet-v4-tf_interp.py 22.22% <22.22%> (ø)
...vino_plugin/samples/clip_visual_ViT-B_32_interp.py 31.25% <31.25%> (ø)
...envino_plugin/samples/clip_text_ViT-B_32_interp.py 44.44% <50.00%> (ø)
...vino_plugin/samples/mobilenet_v2_pytorch_interp.py 25.00% <50.00%> (+2.77%) ⬆️
...envino_plugin/samples/ssd_face_detection_interp.py 12.24% <50.00%> (+1.60%) ⬆️
...gin/samples/ssd_mobilenet_coco_detection_interp.py 13.20% <50.00%> (+1.44%) ⬆️
...vino_plugin/samples/ssd_person_detection_interp.py 12.24% <50.00%> (+1.60%) ⬆️
...amples/ssd_person_vehicle_bike_detection_interp.py 11.76% <50.00%> (+1.56%) ⬆️
...ino_plugin/samples/ssd_vehicle_detection_interp.py 12.24% <50.00%> (+1.60%) ⬆️
datumaro/plugins/openvino_plugin/launcher.py 63.85% <72.41%> (+17.08%) ⬆️
... and 4 more

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

@vinnamkim vinnamkim left a comment

Choose a reason for hiding this comment

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

LGTM.

@wonjuleee wonjuleee merged commit f1b0f27 into openvinotoolkit:develop Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ENHANCE Enhancement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants