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

fix error when extracting exif metadata features from images in RAI Vision dashboard #2461

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

imatiach-msft
Copy link
Contributor

Description

fix error when extracting exif metadata features from images in RAI Vision dashboard

Customer encountered exception:

Traceback (most recent call last):
  File "./rai_vision_insights.py", line 540, in <module>
    main(args)
  File "/azureml-envs/responsibleai-vision/lib/python3.8/site-packages/azureml/rai/utils/telemetry/loggerfactory.py", line 153, in wrapper
    return func(*args, **kwargs)
  File "./rai_vision_insights.py", line 456, in main
    rai_vi = RAIVisionInsights(
  File "/azureml-envs/responsibleai-vision/lib/python3.8/site-packages/responsibleai_vision/rai_vision_insights/rai_vision_insights.py", line 269, in __init__
    ext_test, ext_features = extract_features(
  File "/azureml-envs/responsibleai-vision/lib/python3.8/site-packages/responsibleai_vision/utils/feature_extractors.py", line 86, in extract_features
    row_feature_values[feature_names.index(tag)] = data
ValueError: 'XPComment' is not in list

To fix these, a set of test cases were added to the metadata feature extraction logic. By adding the XPComment field, which contains a string of bytes, the issue was reproduced and fixed locally. Also some other issues were found and fixed with the method, such as an error when feature metdata parameter is unspecified.

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@imatiach-msft imatiach-msft force-pushed the ilmat/fix-exif-xpcomment-metadata-err branch from 065f3b3 to cdd0e9c Compare December 14, 2023 20:33
1 similar comment
@imatiach-msft imatiach-msft force-pushed the ilmat/fix-exif-xpcomment-metadata-err branch from cdd0e9c to f4c614b Compare December 14, 2023 21:54
@imatiach-msft imatiach-msft force-pushed the ilmat/fix-exif-xpcomment-metadata-err branch 2 times, most recently from 5bf5413 to 4ba5d2c Compare December 14, 2023 23:01
1 similar comment
@imatiach-msft imatiach-msft force-pushed the ilmat/fix-exif-xpcomment-metadata-err branch from 4ba5d2c to 3be2e84 Compare December 14, 2023 23:54
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (0700cdc) 89.72% compared to head (3be2e84) 81.04%.

Files Patch % Lines
...n/responsibleai_vision/utils/feature_extractors.py 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2461      +/-   ##
==========================================
- Coverage   89.72%   81.04%   -8.68%     
==========================================
  Files         122       26      -96     
  Lines        6751     2316    -4435     
==========================================
- Hits         6057     1877    -4180     
+ Misses        694      439     -255     
Flag Coverage Δ
unittests 81.04% <81.81%> (-8.68%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imatiach-msft imatiach-msft merged commit 6cb95c0 into main Dec 15, 2023
106 checks passed
@imatiach-msft imatiach-msft deleted the ilmat/fix-exif-xpcomment-metadata-err branch December 15, 2023 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants