Metadata-Version: 2.1
Name: incx
Version: 0.0.1
Summary: 
Author: Santiago Calderón
Author-email: santiagocalderon1999@gmail.com
Requires-Python: >=3.10,<3.13
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: azure-identity (>=1.17.1,<2.0.0)
Requires-Dist: azure-storage-blob (>=12.21.0,<13.0.0)
Requires-Dist: captum (>=0.7.0,<0.8.0)
Requires-Dist: cvzone (>=1.6.1,<2.0.0)
Requires-Dist: dill (>=0.3.8,<0.4.0)
Requires-Dist: filterpy (>=1.4.5,<2.0.0)
Requires-Dist: ipykernel (>=6.29.5,<7.0.0)
Requires-Dist: matplotlib (==3.6.3)
Requires-Dist: ml-wrappers (>=0.5.5,<0.6.0)
Requires-Dist: numpy (==1.26.0)
Requires-Dist: opencv-python (==4.9.0.80)
Requires-Dist: pydantic (>=2.8.2,<3.0.0)
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
Requires-Dist: ruff (>=0.5.6,<0.6.0)
Requires-Dist: scikit-image (>=0.24.0,<0.25.0)
Requires-Dist: seaborn (>=0.13.2,<0.14.0)
Requires-Dist: torch (>=2.3.1,<3.0.0)
Requires-Dist: torchvision (>=0.18.1,<0.19.0)
Requires-Dist: ultralytics (==8.2.55)
Description-Content-Type: text/markdown

# Incx

IncX (**Inc**remental E**x**planations) is an innovative approach designed to incrementally generate saliency maps and explanations in real-time.

![Penguin Gif](blob/penguin.gif)

## Getting Started

To run this project, you will need to use `pyenv` for Python version management and `poetry` for dependency management. Below are the steps to set up your environment and run the project.

### Prerequisites

1. **Pyenv Installation**  
   Pyenv is a tool for managing multiple versions of Python on your system. Follow the instructions below to install it:
   
   - **Linux and macOS:** Follow the instructions in the [pyenv GitHub repository](https://github.com/pyenv/pyenv?tab=readme-ov-file#getting-pyenv) to install pyenv.
   - **Windows:** Use [pyenv-win](https://github.com/pyenv-win/pyenv-win?tab=readme-ov-file#installation) to install pyenv for Windows.

2. **Installing Python Version**  
   Once pyenv is installed, use it to install the Python version specified in the `.python-version` file located in the root directory of this project. Run the following command:

   ```shell
   pyenv install
   ```

3. Install [poetry](https://python-poetry.org/docs/#installation)

4. Configure poetry to create virtual environments in the current project directory. This will ensure that you can easily handle different environments for different projects.

   ```shell
   poetry config virtualenvs.in-project true
   ```

5. Use poetry to install the project dependencies and create a virtual environment:

   ```shell
   poetry install
   ```


## Experiments

To replicate the experiments comparing D-RISE and IncX, follow these steps:

1. 
poetry run pytest --cov=incrementalexplainer --cov-report=term-missing

python experiments/d_rise/get_blob_names.py

python experiments/d_rise/get_metrics.py

poetry run python experiments/incx/get_job_names.py

python experiments/incx/get_saliency_maps.py

# Unit Tests

To ensure the code is working correctly and is well-covered by tests, run the following command using poetry and pytest:

```shell
poetry run pytest
```
This command will execute all the tests defined in the `tests/` directory, providing feedback on code correctness and coverage.

# Linting and Formatting

To maintain code quality and style consistency, use the following commands:

1. **Linting**
    Use `ruff` to check for code issues and automatically fix them:

    ```shell
    poetry run ruff check . --fix
    ```
2. **Formatting**
    Use `ruff` to format the code according to style guidelines:

    ```shell
    poetry run ruff format .
    ```

# How to install the package

```shell
pip install incx
```
