semvec/pypi-packages huggingface dataset:
haros 3.10.20
Static analysis framework for ROS
License: MIT
Keywords: static-analysis ros

[![DOI](https://zenodo.org/badge/27440980.svg)](https://zenodo.org/badge/latestdoi/27440980)

![HAROS](logo.png?raw=true "HAROS Logo")

HAROS is a framework for quality assurance of ROS-based code, mostly based on **static analysis** - which consists on *extracting information* from the source code *without executing it* (and, sometimes, even without compiling it).
Its main goal is the **early detection of problems** in the software development life cycle, which would otherwise go unnoticed into later stages or even into production.

**Try it yourself:** there is a demo page of the HAROS visualizer available on [GitHub](https://git-afsantos.github.io/haros).

**Tutorials:** [on GitHub](https://github.com/git-afsantos/haros_tutorials/) and [on YouTube](https://youtube.com/playlist?list=PLrXxXaugT0cwVhjhlnxY6DU0_WYPLEmgq).

**More info:** short video presentation [on YouTube](https://www.youtube.com/watch?v=s_Zmch8xjzQ).

## Current Status

HAROS is still being developed, as of August 2021.
Help improve HAROS by participating in a short [user survey](https://docs.google.com/forms/d/e/1FAIpQLSdD0nC2tb_IBjvasoWDOR_LzplTYF4cGkI5ZQqJtgDAe8ZQsQ/viewform?usp=sf_link).

## Installing

See [INSTALL](./INSTALL.md) for installation methods and instructions.

## How to Use

See [USAGE](./docs/USAGE.md) for basic commands and usage instructions.

## Bugs, Questions and Support

Check whether your question has an answer in the [FAQ](./docs/FAQ.md).

Please use the [issue tracker](https://github.com/git-afsantos/haros/issues) for issues or feature requests directly related to HAROS.

For issues related to plugins, please use the respective plugin repository.

If you run into errors, or feel that something is not working, run HAROS in debug mode, so the log files do not miss any information, e.g.,

```
haros --debug analyse ...
```

Then, you can share the log file, found by default within `~/.haros/log.txt`.

## Citing

See [CITING](./CITING.md).

## Contributing

See [CONTRIBUTING](./CONTRIBUTING.md).

## Acknowledgment

Until March 2021, this work was financed by the ERDF – European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciência e a Tecnologia within project PTDC/CCI-INF/29583/2017 (POCI-01-0145-FEDER-029583).
explainable-ai-image-measures 1.0.1
Compute IAUC, DAUC, IROF scores to measure quality of image attributions
License: MIT

# Compute IAUC, DAUC, IROF scores to measure the quality of image attributions (PyTorch)

This package allows to evaluate the quality of attributions wrt. to your original iamge. 
For that purpose, you can compute IAUC (Insert Area Under Curve, Insertion score), DAUC (Delete Area Under Curve, Deletion score) and IROF (Iterative Removal Of Features).

Install via [PyPi](https://pypi.org/project/explainable-ai-image-measures/):
``pip install explainable-ai-image-measures``

The shared idea behind all of them is to remove the most relevant pixels from the original image and replace it by a baseline color (DAUC, IROF) or to take blank a blank image and add the most relevant pixels again starting with the most relevant (IAUC). In contrast to IAUC and DAUC, IROF does this superpixel-wise. 
1. Create new images by removing / adding pixels / entire areas
2. Send the newly created images through the network and save the probabilities.
3. Compute the Area Under the Curve (AUC) for the recorded probabilities. 
4. Interpretation: For DAUC lower scores are better, for IROF and IAUC higher scores.

![See github for a gif visualization of the mechanics](irof.gif)

In contrast to other publicly available code, 
* all of the heavy computation is running on the GPU (no numpy or CPU in between)
* you can compute the scores for a single image also batch-wise
* there is parametrization possible to suit your needs
* IAUC, DAUC and IROF is possible using a single package
* multiple attributions for multiple images are possible (see example.ipynb)

Here a minimal code for a single image: 
```python
import torch
from captum.attr import Saliency
import torchvision.models as models

from explainable_ai_image_measures import Measures

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = models.resnet18(pretrained=True).to(device)

image = torch.rand((1, 3, 224, 224)).to(device)
attribution = Saliency(model).attribute(image, target=17)

# Average the attribution over the color channels
attribution = torch.mean(attribution, dim=1)

measure = Measures(model, batch_size=250, irof_segments=70)
score, y = measure.compute_IROF(image[0], attribution[0], 17)

```