• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bethgelab / foolbox / 8137716344

22 Jan 2024 10:53PM UTC coverage: 98.47%. Remained the same
8137716344

push

github

web-flow
Bump pillow from 10.1.0 to 10.2.0 in /tests (#718)

Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.1.0...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

3475 of 3529 relevant lines covered (98.47%)

7.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/foolbox/attacks/inversion.py
1
from typing import Union, Any, Optional
10✔
2
import eagerpy as ep
10✔
3

4
from ..criteria import Criterion
10✔
5

6
from ..models import Model
10✔
7

8
from .base import FlexibleDistanceMinimizationAttack
10✔
9
from .base import T
10✔
10
from .base import raise_if_kwargs
10✔
11
from .base import verify_input_bounds
10✔
12

13

14
class InversionAttack(FlexibleDistanceMinimizationAttack):
10✔
15
    """Creates "negative images" by inverting the pixel values. [#Hos16]_
16

17
    References:
18
        .. [#Hos16] Hossein Hosseini, Baicen Xiao, Mayoore Jaiswal, Radha Poovendran,
19
               "On the Limitation of Convolutional Neural Networks in Recognizing
20
               Negative Images",
21
               https://arxiv.org/abs/1607.02533
22
    """
23

24
    def run(
10✔
25
        self,
26
        model: Model,
27
        inputs: T,
28
        criterion: Union[Criterion, Any] = None,
29
        *,
30
        early_stop: Optional[float] = None,
31
        **kwargs: Any,
32
    ) -> T:
33
        raise_if_kwargs(kwargs)
8✔
34
        x, restore_type = ep.astensor_(inputs)
8✔
35
        del inputs, criterion, kwargs
8✔
36

37
        verify_input_bounds(x, model)
8✔
38

39
        min_, max_ = model.bounds
8✔
40
        x = min_ + max_ - x
8✔
41
        return restore_type(x)
8✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc