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

Adding type preservation to insert_image #1441

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

keykholt
Copy link
Collaborator

Description

This PR address issue 1440. At the start of the function, the dtype of the original data is stored. Before returning the modified image, the return value is cast back to the original dtype.

Fixes # 1440

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Kevin Eykholt <kheykholt@gmail.com>
@keykholt keykholt changed the base branch from main to dev_1.9.0 December 14, 2021 17:10
@lgtm-com
Copy link

lgtm-com bot commented Dec 14, 2021

This pull request introduces 12 alerts when merging 69a8d2b into 09e0e19 - view on LGTM.com

new alerts:

  • 12 for Module is imported more than once

@beat-buesser beat-buesser self-requested a review December 14, 2021 18:33
@beat-buesser beat-buesser self-assigned this Dec 14, 2021
@beat-buesser beat-buesser added bug Something isn't working improvement Improve implementation labels Dec 14, 2021
@beat-buesser beat-buesser added this to Pull request open in ART 1.9.0 via automation Dec 14, 2021
@beat-buesser beat-buesser added this to the ART 1.9.0 milestone Dec 14, 2021
@beat-buesser
Copy link
Collaborator

closing and reopening to get tests started

ART 1.9.0 automation moved this from Pull request open to Pull request done Dec 14, 2021
@beat-buesser beat-buesser reopened this Dec 14, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #1441 (69a8d2b) into dev_1.9.0 (c114a49) will increase coverage by 0.55%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##           dev_1.9.0    #1441      +/-   ##
=============================================
+ Coverage      89.85%   90.41%   +0.55%     
=============================================
  Files            237      237              
  Lines          19386    19387       +1     
  Branches        3438     3438              
=============================================
+ Hits           17420    17528     +108     
+ Misses          1172     1077      -95     
+ Partials         794      782      -12     
Impacted Files Coverage Δ
...cks/poisoning/perturbations/image_perturbations.py 89.74% <100.00%> (+0.13%) ⬆️
art/attacks/evasion/boundary.py 92.72% <0.00%> (-1.22%) ⬇️
art/utils.py 90.92% <0.00%> (+16.28%) ⬆️
art/visualization.py 90.47% <0.00%> (+16.66%) ⬆️
art/data_generators.py 93.97% <0.00%> (+27.71%) ⬆️

Copy link
Collaborator

@beat-buesser beat-buesser left a comment

Choose a reason for hiding this comment

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

Hi @keykholt Looks good to me. Thank you very much!

@beat-buesser beat-buesser merged commit 24d7062 into Trusted-AI:dev_1.9.0 Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement Improve implementation
Projects
No open projects
ART 1.9.0
  
Pull request done
Development

Successfully merging this pull request may close these issues.

insert_image in art.attacks.poisoning.perturbations does not preserve the dtype of the passed ndarray.
3 participants