Skip to content

Commit

Permalink
Major Development (#15)
Browse files Browse the repository at this point in the history
* solve minor issues

* implement Beyond AUROC \& Co.

* small changes

* improve aggregations

* fix typo

* ninco ssb clean benchmark

* update imagenet benchmarks

* small changes

* p-value combining method

* small changes

* update doi

* update some datasets to hf hub

* crop_pct bug

* Ensembling + SC

* fix pipelines

* docs

* fix docstrings

* remove requirements.txt

* remove ba

* bump version

* minor fix
  • Loading branch information
edadaltocg authored Jan 2, 2024
1 parent 3555eba commit 1a312c8
Show file tree
Hide file tree
Showing 70 changed files with 76,606 additions and 70,580 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ max-line-length = 120
max-complexity = 10
extend-ignore =
E203,
F401,
per-file-ignores =
# imported but unused
__init__.py: F401,F403,E402
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ jobs:


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,9 +29,9 @@ jobs:
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
# - name: Update version in setup.py
# run: >-
# sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
- name: Build a binary wheel
run: >-
python setup.py sdist bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create new patch release
run: python .github/scripts/release.py
env:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ dmypy.json
# data
/data

# cluster
/cluster

# logs
/results
/storage
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Please follow the instructions [here](https://pytorch.org/get-started/locally/)

```bash
pip install detectors
pip install -q git+https://github.com/edadaltocg/detectors.git
```

To install the latest version from the source:
Expand Down Expand Up @@ -144,6 +143,10 @@ print(detectors.list_pipelines())

- [Documentation](https://detectors.readthedocs.io/en/latest/use_cases/)

**Pypi**

- [Website](https://pypi.org/project/detectors)

## Contributing

As an open-source project in a rapidly developing field, we are open to contributions, whether in the form of a new feature, improved infra, or better documentation.
Expand Down Expand Up @@ -178,11 +181,12 @@ The detection of Out-of-Distribution (OOD) has created a new way of securing mac
If you find this repository useful, please consider giving it a star 🌟 and citing it as below:

```bibtex
@software{detectors,
author = {},
title = {Detectors: Generalized Out-Of-Distribution Detection Library},
@software{detectors2023,
author = {Eduardo Dadalto},
title = {Detectors: a Python Library for Generalized Out-Of-Distribution Detection},
url = {https://github.com/edadaltocg/detectors},
doi = {https://doi.org/10.5281/zenodo.7883596},
month = {5},
year = {2023}
}
```
```
8 changes: 8 additions & 0 deletions docs/source/detectors.aggregations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ detectors.aggregations.mahalanobis module
:undoc-members:
:show-inheritance:

detectors.aggregations.power module
-----------------------------------

.. automodule:: detectors.aggregations.power
:members:
:undoc-members:
:show-inheritance:

detectors.aggregations.quantile module
--------------------------------------

Expand Down
24 changes: 24 additions & 0 deletions docs/source/detectors.data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ detectors.data package
Submodules
----------

detectors.data.300k\_random\_images module
------------------------------------------

.. automodule:: detectors.data.300k_random_images
:members:
:undoc-members:
:show-inheritance:

detectors.data.cifar\_wrapper module
------------------------------------

Expand Down Expand Up @@ -100,6 +108,14 @@ detectors.data.mos module
:undoc-members:
:show-inheritance:

detectors.data.ninco\_ssb\_clean module
---------------------------------------

.. automodule:: detectors.data.ninco_ssb_clean
:members:
:undoc-members:
:show-inheritance:

detectors.data.noise module
---------------------------

Expand Down Expand Up @@ -148,6 +164,14 @@ detectors.data.tiny\_imagenet\_r\_c module
:undoc-members:
:show-inheritance:

detectors.data.utils module
---------------------------

.. automodule:: detectors.data.utils
:members:
:undoc-members:
:show-inheritance:

detectors.data.wilds\_ds module
-------------------------------

Expand Down
88 changes: 88 additions & 0 deletions docs/source/detectors.methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ detectors.methods.ae module
:undoc-members:
:show-inheritance:

detectors.methods.argmax module
-------------------------------

.. automodule:: detectors.methods.argmax
:members:
:undoc-members:
:show-inheritance:

detectors.methods.ash module
----------------------------

.. automodule:: detectors.methods.ash
:members:
:undoc-members:
:show-inheritance:

detectors.methods.bats module
-----------------------------

Expand Down Expand Up @@ -100,6 +116,14 @@ detectors.methods.gram module
:undoc-members:
:show-inheritance:

detectors.methods.igeood\_features module
-----------------------------------------

.. automodule:: detectors.methods.igeood_features
:members:
:undoc-members:
:show-inheritance:

detectors.methods.igeood\_logits module
---------------------------------------

Expand All @@ -116,6 +140,14 @@ detectors.methods.kl\_matching module
:undoc-members:
:show-inheritance:

detectors.methods.knn\_cosine module
------------------------------------

.. automodule:: detectors.methods.knn_cosine
:members:
:undoc-members:
:show-inheritance:

detectors.methods.knn\_euclides module
--------------------------------------

Expand All @@ -124,6 +156,22 @@ detectors.methods.knn\_euclides module
:undoc-members:
:show-inheritance:

detectors.methods.knn\_projection module
----------------------------------------

.. automodule:: detectors.methods.knn_projection
:members:
:undoc-members:
:show-inheritance:

detectors.methods.l1norm module
-------------------------------

.. automodule:: detectors.methods.l1norm
:members:
:undoc-members:
:show-inheritance:

detectors.methods.logit\_norm module
------------------------------------

Expand All @@ -140,6 +188,14 @@ detectors.methods.mahalanobis module
:undoc-members:
:show-inheritance:

detectors.methods.masf module
-----------------------------

.. automodule:: detectors.methods.masf
:members:
:undoc-members:
:show-inheritance:

detectors.methods.max\_logits module
------------------------------------

Expand Down Expand Up @@ -204,6 +260,22 @@ detectors.methods.openmax module
:undoc-members:
:show-inheritance:

detectors.methods.plugin\_bb module
-----------------------------------

.. automodule:: detectors.methods.plugin_bb
:members:
:undoc-members:
:show-inheritance:

detectors.methods.pnml module
-----------------------------

.. automodule:: detectors.methods.pnml
:members:
:undoc-members:
:show-inheritance:

detectors.methods.projection module
-----------------------------------

Expand Down Expand Up @@ -244,6 +316,22 @@ detectors.methods.relative\_mahalanobis module
:undoc-members:
:show-inheritance:

detectors.methods.residual module
---------------------------------

.. automodule:: detectors.methods.residual
:members:
:undoc-members:
:show-inheritance:

detectors.methods.she module
----------------------------

.. automodule:: detectors.methods.she
:members:
:undoc-members:
:show-inheritance:

detectors.methods.ssd module
----------------------------

Expand Down
8 changes: 8 additions & 0 deletions docs/source/detectors.models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ detectors.models.densenet module
:undoc-members:
:show-inheritance:

detectors.models.dino module
----------------------------

.. automodule:: detectors.models.dino
:members:
:undoc-members:
:show-inheritance:

detectors.models.resnet module
------------------------------

Expand Down
30 changes: 27 additions & 3 deletions docs/source/detectors.pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ detectors.pipelines.covariate\_drift module
:undoc-members:
:show-inheritance:

detectors.pipelines.drift module
--------------------------------

.. automodule:: detectors.pipelines.drift
:members:
:undoc-members:
:show-inheritance:

detectors.pipelines.misclassif module
-------------------------------------

.. automodule:: detectors.pipelines.misclassif
:members:
:undoc-members:
:show-inheritance:

detectors.pipelines.ood module
------------------------------

Expand All @@ -36,10 +52,18 @@ detectors.pipelines.osr module
:undoc-members:
:show-inheritance:

detectors.pipelines.ttoodda module
----------------------------------
detectors.pipelines.sc module
-----------------------------

.. automodule:: detectors.pipelines.sc
:members:
:undoc-members:
:show-inheritance:

detectors.pipelines.scod module
-------------------------------

.. automodule:: detectors.pipelines.ttoodda
.. automodule:: detectors.pipelines.scod
:members:
:undoc-members:
:show-inheritance:
Expand Down
21 changes: 21 additions & 0 deletions docs/source/detectors.preprocessing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
detectors.preprocessing package
===============================

Submodules
----------

detectors.preprocessing.basics module
-------------------------------------

.. automodule:: detectors.preprocessing.basics
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: detectors.preprocessing
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 1a312c8

Please sign in to comment.